Refactor code converting a publication name List to a StringInfo
Michael Paquier <michael@paquier.xyz>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/catalog/pg_subscription.c | modified | +31 −0 |
| src/backend/commands/subscriptioncmds.c | modified | +14 −46 |
| src/backend/replication/logical/tablesync.c | modified | +9 −26 |
| src/include/catalog/pg_subscription.h | modified | +4 −1 |
Discussion
- Refactor to use common function 'get_publications_str'. 13 messages · 2024-10-23 → 2024-10-25