Re: Refactor to use common function 'get_publications_str'.

From: Peter Smith <smithpb2250(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Refactor to use common function 'get_publications_str'.
Date: 2024-10-23 07:25:14
Message-ID: CAHut+PuVEHu62iWpBwnMEwxLYKEA-1TB888Mm1qB6rjbbXn+fw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Oct 23, 2024 at 5:23 PM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> 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.
>

Thanks for your review and feedback!

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

My bad, fixed in patch v2.

======
Kind Regards,
Peter Smith.
Fujitsu Austalia

Attachment Content-Type Size
v2-0001-Refactor-to-use-common-function-GetPublicationsSt.patch application/octet-stream 10.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jehan-Guillaume de Rorthais 2024-10-23 08:01:54 Re: [BUG] Fix DETACH with FK pointing to a partitioned table fails
Previous Message Peter Smith 2024-10-23 06:55:55 Re: Pgoutput not capturing the generated columns