pgsql: Fixup some appendStringInfo and appendPQExpBuffer calls

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fixup some appendStringInfo and appendPQExpBuffer calls
Date: 2020-10-15 07:36:24
Message-ID: E1kSxoG-0007OH-Vi@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fixup some appendStringInfo and appendPQExpBuffer calls

A number of places were using appendStringInfo() when they could have been
using appendStringInfoString() instead. While there's no functionality
change there, it's just more efficient to use appendStringInfoString()
when no formatting is required. Likewise for some
appendStringInfoString() calls which were just appending a single char.
We can just use appendStringInfoChar() for that.

Additionally, many places were using appendPQExpBuffer() when they could
have used appendPQExpBufferStr(). Change those too.

Patch by Zhijie Hou, but further searching by me found significantly more
places that deserved the same treatment.

Author: Zhijie Hou, David Rowley
Discussion: https://postgr.es/m/cb172cf4361e4c7ba7167429070979d4@G08CNEXMBPEKD05.g08.fujitsu.local

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/110d81728a0a006abcf654543fc15346f8043dc0

Modified Files
--------------
contrib/postgres_fdw/postgres_fdw.c | 4 +-
contrib/test_decoding/test_decoding.c | 12 +-
src/backend/access/rmgrdesc/dbasedesc.c | 2 +-
src/backend/commands/explain.c | 16 +-
src/backend/replication/backup_manifest.c | 6 +-
.../libpqwalreceiver/libpqwalreceiver.c | 2 +-
src/backend/replication/logical/tablesync.c | 2 +-
src/backend/utils/adt/jsonpath.c | 2 +-
src/backend/utils/adt/ri_triggers.c | 2 +-
src/backend/utils/adt/ruleutils.c | 4 +-
src/bin/pg_dump/pg_dump.c | 228 ++++++++++-----------
src/bin/pg_upgrade/version.c | 44 ++--
src/bin/psql/describe.c | 56 +++--
src/bin/scripts/reindexdb.c | 44 ++--
src/pl/plpython/plpy_elog.c | 2 +-
15 files changed, 210 insertions(+), 216 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Fujii Masao 2020-10-15 07:51:57 pgsql: Improve tab-completion for FETCH/MOVE.
Previous Message Fujii Masao 2020-10-15 07:21:39 Re: pgsql: postgres_fdw: reestablish new connection if cached one is detect