pgsql: Refactor code converting a publication name List to a StringInfo

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor code converting a publication name List to a StringInfo
Date: 2024-10-25 03:03:04
Message-ID: E1t4AbQ-002Jdt-HY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/248c2d19238c7616531caa8b3101cca4f656185c

Modified Files
--------------
src/backend/catalog/pg_subscription.c | 31 +++++++++++++++
src/backend/commands/subscriptioncmds.c | 60 +++++++----------------------
src/backend/replication/logical/tablesync.c | 35 +++++------------
src/include/catalog/pg_subscription.h | 5 ++-
4 files changed, 58 insertions(+), 73 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2024-10-25 06:06:10 Re: pgsql: Implement pg_wal_replay_wait() stored procedure
Previous Message Michael Paquier 2024-10-25 01:56:50 pgsql: Add install rules for Kerberos.pm and AdjustUpgrade.pm