Use appendStringInfoString and appendPQExpBufferStr where possible
Hi hackers
In(/src/bin/scripts/reindexdb.c; /src/backend/access/rmgrdesc/dbasedesc.c; /src/pl/plpython/plpy_elog.c)
I found some more places that should use appendPQExrBufferStr instead of appendPQExpBuffer.
Here is the patch.
Previous Discussion:
/messages/by-id/CAKJS1f9P=M-3ULmPvr8iCno8yvfDViHibJjpriHU8+SXUgeZ=w@mail.gmail.com
Best regards,
Houzj/huangj
Attachments:
0001-appendPQExpBufferStr-instead-of-appendPQExpBuffer.patchapplication/octet-stream; name=0001-appendPQExpBufferStr-instead-of-appendPQExpBuffer.patchDownload+4-5
0001-Use-appendStringInfoString-instead-of-appendStringIn.patchapplication/octet-stream; name=0001-Use-appendStringInfoString-instead-of-appendStringIn.patchDownload+2-3
On Tue, 22 Sep 2020 at 17:00, Hou, Zhijie <houzj.fnst@cn.fujitsu.com> wrote:
I found some more places that should use appendPQExrBufferStr instead of appendPQExpBuffer.
Here is the patch.
Seems like a good idea. Please add it to the next commitfest.
David
On Tue, 22 Sep 2020 at 17:00, Hou, Zhijie <houzj.fnst@cn.fujitsu.com> wrote:
I found some more places that should use appendPQExrBufferStr instead
of appendPQExpBuffer.
Here is the patch.
Seems like a good idea. Please add it to the next commitfest.
Thanks, added it to the next commitfest.
https://commitfest.postgresql.org/30/2735/
Best regards,
houzj
Hi
I made a slight update to the patch
I found some more places that should use appendPQExrBufferStr instead
of appendPQExpBuffer.
Here is the patch.
Seems like a good idea. Please add it to the next commitfest.
Thanks, added it to the next commitfest.
https://commitfest.postgresql.org/30/2735/
Best regards,
houzj
Attachments:
0001-Latest-appendStringInfoString-instead-of-appendStringInfo.patchapplication/octet-stream; name=0001-Latest-appendStringInfoString-instead-of-appendStringInfo.patchDownload+3-5
0001-Latest-appendPQExpBufferStr-instead-of-appendPQExpBuffer.patchapplication/octet-stream; name=0001-Latest-appendPQExpBufferStr-instead-of-appendPQExpBuffer.patchDownload+4-5
Good point. There's another one:
$ git grep -E 'appendStringInfoString.*".{,1}");'
src/backend/utils/adt/ruleutils.c: appendStringInfoString(buf, "(");
I noticed you added a similar thread here.
https://commitfest.postgresql.org/30/
I think this one could be combined as a single patchset with the existing CF entry for the other thread.
Thanks for your response, combined them as a single patchset now.
Best regards,
Attachments:
0001-Latest-appendStringInfoString-instead-of-appendStringInfo.patchapplication/octet-stream; name=0001-Latest-appendStringInfoString-instead-of-appendStringInfo.patchDownload+3-5
0001-appendStringInfoChar-instead-of-appendStringInfoString.patchapplication/octet-stream; name=0001-appendStringInfoChar-instead-of-appendStringInfoString.patchDownload+4-5
0001-Latest-appendPQExpBufferStr-instead-of-appendPQExpBuffer.patchapplication/octet-stream; name=0001-Latest-appendPQExpBufferStr-instead-of-appendPQExpBuffer.patchDownload+4-5
On Mon, 28 Sep 2020 at 13:47, Hou, Zhijie <houzj.fnst@cn.fujitsu.com> wrote:
Thanks for your response, combined them as a single patchset now.
I had a look over the three patches. All the changes look fine.
Thanks for working on it.
After a bit of grep work, I found about 6 times more calls that could
be improved. These involved searching for appendStringInfo calls that
could become appendStringInfoString calls and also appendPQExpBuffer
that could be converted to appendPQExpBufferStr.
I didn't really go hunting for any other calls that append a 1 char
string that don't use the Char variant of the function. So perhaps
there's more of those to be found.
I've attached the patch I ended up with. I plan on pushing this in the
next few days.
David