From: Mats Kindahl <mats.kindahl@gmail.com>
To: Amit Kapila <amit.kapila16@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: Refactor StringInfo usage in subscriptioncmds.c
Date: Thu, 6 Nov 2025 13:34:54 +0100
Message-ID: <1f87b8de-9032-46bc-ad0d-382af2c591fb@gmail.com> (raw)
In-Reply-To: <CAA4eK1L8O=PNRXCeB3aQ=A3ZNQ5ssP4yC_k3GG+kJ6GZe6-Mqw@mail.gmail.com>
References: <0b381b02-cab9-41f9-a900-ad6c8d26c1fc@gmail.com>
<CAApHDvpiprh4Geb+T=96OCNG31PSgrp7cCihy9R0ovOfttxkjw@mail.gmail.com>
<CAA4eK1L8O=PNRXCeB3aQ=A3ZNQ5ssP4yC_k3GG+kJ6GZe6-Mqw@mail.gmail.com>
On 11/6/25 13:09, Amit Kapila wrote:
> On Thu, Nov 6, 2025 at 5:24 PM David Rowley <dgrowleyml@gmail.com> wrote:
>> On Fri, 7 Nov 2025 at 00:38, Mats Kindahl <mats.kindahl@gmail.com> wrote:
>>> As discussed in [1] the functions check_publications_origin_tables() and
>>> check_publications_origin_sequences() are building error messages using
>>> dynamically allocated StringInfo instances only to avoid duplicating a
>>> call of ereport().
>> Looks better and more traditional to me, plus git diff --stat reports:
>>
>> 1 file changed, 28 insertions(+), 33 deletions(-)
>>
>> It has my vote. I've included Vignesh and Amit to see if they're also
>> ok with it.
>>
> LGTM as well. We can avoid doing pfree(pubnames.data) as it is not
> allocated in any long term context but I am fine if we want to do it
> as there are places where we do such retail pfree as well.
I have no strong opinion either way, but since it is not needed and it
is not a frequent call it seemed prudent to free it after.
Best wishes,
Mats Kindahl
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-hackers@postgresql.org
Cc: mats.kindahl@gmail.com, amit.kapila16@gmail.com, dgrowleyml@gmail.com, vignesh21@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Refactor StringInfo usage in subscriptioncmds.c
In-Reply-To: <1f87b8de-9032-46bc-ad0d-382af2c591fb@gmail.com>
* 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