public inbox for [email protected]  
help / color / mirror / Atom feed
From: Michael Paquier <[email protected]>
To: Peter Smith <[email protected]>
Cc: Masahiko Sawada <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Subject: Re: Refactor to use common function 'get_publications_str'.
Date: Thu, 24 Oct 2024 15:41:15 +0900
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAHut+PswWp-4jv3nmQ_UVyXKJmfBR4osBtJ5fPs5h=rUwDEM7A@mail.gmail.com>
References: <CAHut+PtJMk4bKXqtpvqVy9ckknCgK9P6=FeG8zHF=6+Em_Snpw@mail.gmail.com>
	<[email protected]>
	<CAHut+PuVEHu62iWpBwnMEwxLYKEA-1TB888Mm1qB6rjbbXn+fw@mail.gmail.com>
	<CAD21AoARPYOP+RTn7UZ8Ybja-HW5aU3N=aNeo7uD2gGG-ZS21g@mail.gmail.com>
	<CAHut+PshwcOdq+MbgEM2ardEvCVXHxL-6SDzZo4aA=v+qgr7iA@mail.gmail.com>
	<CAD21AoCf6c9WAA2fdvCF14so-BffK1B1JAWnxTX-Cm8Q0gJH5w@mail.gmail.com>
	<[email protected]>
	<CAHut+PswWp-4jv3nmQ_UVyXKJmfBR4osBtJ5fPs5h=rUwDEM7A@mail.gmail.com>

On Thu, Oct 24, 2024 at 05:27:25PM +1100, Peter Smith wrote:
> Yes, well spotted -- I was aware of that. Originally I had coded a >=
> PG15 check for that pub_names assignment. e.g.
> 
> if (walrcv_server_version(LogRepWorkerWalRcvConn) >= 150000)
>   GetPublicationsStr(MySubscription->publications, pub_names, true);

I was wondering about putting the call of GetPublicationsStr() in the
first block with the makeStringInfo(), have an Assert checking that
pub_names->data is never NULL in the second block, and destroy the
StringInfo only if it has been allocated.

> But, somehow it seemed messy to do that just to cater for something I
> thought was not particularly likely. OTOH, I am happy to put that
> check back in if you think it is warranted.

I think I would add it.  The publication list is not mandatory, but
your patch makes it look so.
--
Michael


Attachments:

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

view thread (9+ messages)  latest in thread

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], [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