diff options
| author | Michael Paquier | 2024-10-25 03:02:04 +0000 |
|---|---|---|
| committer | Michael Paquier | 2024-10-25 03:02:04 +0000 |
| commit | 248c2d19238c7616531caa8b3101cca4f656185c (patch) | |
| tree | 2d4a32495c904f7d16f2fb97e904c82abe6fbabe /src/include | |
| parent | 1564339bfe23b2d1aa6403d6a08a7eaae0373cf9 (diff) | |
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
Diffstat (limited to 'src/include')
| -rw-r--r-- | src/include/catalog/pg_subscription.h | 5 |
1 files changed, 4 insertions, 1 deletions
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 */ |
