public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Peter Smith <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Refactor to use common function 'get_publications_str'.
Date: Wed, 23 Oct 2024 15:22:44 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHut+PtJMk4bKXqtpvqVy9ckknCgK9P6=FeG8zHF=6+Em_Snpw@mail.gmail.com>
References: <CAHut+PtJMk4bKXqtpvqVy9ckknCgK9P6=FeG8zHF=6+Em_Snpw@mail.gmail.com>

On Wed, Oct 23, 2024 at 03:44:03PM +1100, Peter Smith wrote:
> During a code review, it was noticed that there are several places
> within logical replication where a comma-separated list of publication
> names is built explicitly. There is already a utility function (called
> 'get_publications_str') for doing this, but it was not being used in
> every place it could have been.

Agreed that this is a good idea, saving from some duplication in the
tablesync code where the same thing is done, with the quoting on top
of that.

-   pfree(cmd.data);
+   pfree(pub_names->data);

The pfree for cmd.data should still be here, no?  And you would need a
pfree(pub_names) as well, meaning that this could just use
destroyStringInfo().
--
Michael


Attachments:

  [application/pgp-signature] signature.asc (833B, ../[email protected]/2-signature.asc)
  download

view thread (2+ messages)

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: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Refactor to use common function 'get_publications_str'.
  In-Reply-To: <[email protected]>

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

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