pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Refactor code converting a publication name List to a StringInfo
Date: Fri, 25 Oct 2024 03:03:04 +0000
Message-ID: <E1t4AbQ-002Jdt-HY@gemulon.postgresql.org> (raw)

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(-)



Message-ID: <E1t4AbQ-002Jdt-HY@gemulon.postgresql.org>
Permalink:  ../E1t4AbQ-002Jdt-HY@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t4AbQ-002Jdt-HY@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Refactor code converting a publication name List to a StringInfo
  In-Reply-To: <E1t4AbQ-002Jdt-HY@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox