Re: Fixup some appendStringInfo and appendPQExpBuffer calls - Mailing list pgsql-hackers

From David Rowley
Subject Re: Fixup some appendStringInfo and appendPQExpBuffer calls
Date
Msg-id CAApHDvp4Ty5VJupumRp1bUuaL2Hsxax1hM99dtZcPPS1AWOkqw@mail.gmail.com
Whole thread Raw
In response to Re: Fixup some appendStringInfo and appendPQExpBuffer calls  (Michael Paquier <michael@paquier.xyz>)
Responses Re: Fixup some appendStringInfo and appendPQExpBuffer calls
Re: Fixup some appendStringInfo and appendPQExpBuffer calls
List pgsql-hackers
On Wed, 2 Jun 2021 at 16:29, Michael Paquier <michael@paquier.xyz> wrote:
>
> On Wed, Jun 02, 2021 at 01:37:51AM +0000, houzj.fnst@fujitsu.com wrote:
> > In the latest HEAD branch, I found some places were using
> > appendStringInfo/appendPQExpBuffer() when they could have been using
> > appendStringInfoString/ appendPQExpBufferStr() instead. I think we'd better
> > fix these places in case other developers will use these codes as a reference,
> > though, it seems will not bring noticeable performance gain.
>
> Indeed, that's the same thing as 110d817 to make all those calls
> cheaper.  No objections from me to do those changes now rather than
> later on HEAD.

I think it would be good to fix at least the instances that are new
code in PG14 before we branch for PG15.  They all seem low enough risk
and worth keeping the new-to-PG14 code as close to the same as
possible between major versions. It seems more likely that newer code
will need bug fixes in the future so having the code as similar as
possible in each branch makes backpatching easier.

For the code that's not new to PG14, I feel less strongly about those.
In the patch there's just 2 instances of these; one in
contrib/sepgsql/schema.c and another in
src/backend/postmaster/postmaster.c.  I've tried to push for these
sorts of things to be fixed at around this time of year in the past,
but there have been other people thinking we should wait until we
branch. For example [1] and [2].

David

[1] https://www.postgresql.org/message-id/CAKJS1f9APLTZRomOSndx_nFcFNfUxncz%3Dp2_-1wr0hrzT4ELKg%40mail.gmail.com
[2] https://www.postgresql.org/message-id/4a84839e-afe4-ea27-6823-23372511dcbf%402ndquadrant.com



pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: parent foreign tables and row marks
Next
From: Thomas Munro
Date:
Subject: Re: Outdated comments about proc->sem in lwlock.c