From 248c2d19238c7616531caa8b3101cca4f656185c Mon Sep 17 00:00:00 2001 From: Michael Paquier Date: Fri, 25 Oct 2024 12:02:04 +0900 Subject: Refactor code converting a publication name List to a StringInfo The existing get_publications_str() is renamed to GetPublicationsStr() and is moved to pg_subscription.c, so as it is possible to reuse it at two locations of the tablesync code where the same logic was duplicated. fetch_remote_table_info() was doing two List->StringInfo conversions when dealing with a server of version 15 or newer. The conversion happens only once now. This refactoring leads to less code overall. Author: Peter Smith Reviewed-by: Michael Paquier, Masahiko Sawada Discussion: https://postgr.es/m/CAHut+PtJMk4bKXqtpvqVy9ckknCgK9P6=FeG8zHF=6+Em_Snpw@mail.gmail.com --- src/include/catalog/pg_subscription.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/include') diff --git a/src/include/catalog/pg_subscription.h b/src/include/catalog/pg_subscription.h index 0aa14ec4a27..b25f3fea566 100644 --- a/src/include/catalog/pg_subscription.h +++ b/src/include/catalog/pg_subscription.h @@ -20,7 +20,7 @@ #include "access/xlogdefs.h" #include "catalog/genbki.h" #include "catalog/pg_subscription_d.h" - +#include "lib/stringinfo.h" #include "nodes/pg_list.h" /* @@ -180,4 +180,7 @@ extern void DisableSubscription(Oid subid); extern int CountDBSubscriptions(Oid dbid); +extern void GetPublicationsStr(List *publications, StringInfo dest, + bool quote_literal); + #endif /* PG_SUBSCRIPTION_H */ -- cgit v1.2.3