Re: Fixup some appendStringInfo and appendPQExpBuffer calls
David Rowley <dgrowleyml@gmail.com>
From: David Rowley <dgrowleyml@gmail.com>
To: Michael Paquier <michael@paquier.xyz>
Cc: "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-03T01:53:34Z
Lists: 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
Commits
-
Clean up some questionable usages of DatumGet* macros
- 8bdb36aab287 14.0 landed
-
Standardize usages of appendStringInfo and appendPQExpBuffer
- f736e188ce70 14.0 landed