Re: Fixup some appendStringInfo and appendPQExpBuffer calls

From: David Rowley <dgrowleyml(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Fixup some appendStringInfo and appendPQExpBuffer calls
Date: 2021-06-03 01:53:34
Message-ID: CAApHDvp4Ty5VJupumRp1bUuaL2Hsxax1hM99dtZcPPS1AWOkqw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 2 Jun 2021 at 16:29, Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Wed, Jun 02, 2021 at 01:37:51AM +0000, houzj(dot)fnst(at)fujitsu(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-06-03 02:07:02 Re: Outdated comments about proc->sem in lwlock.c
Previous Message Amit Langote 2021-06-03 01:07:57 Re: parent foreign tables and row marks