pgsql: Fixup various older misuses of appendPQExpBuffer

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Fixup various older misuses of appendPQExpBuffer
Date: 2025-04-18 00:15:25
Message-ID: E1u5ZO8-000YfL-3D@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fixup various older misuses of appendPQExpBuffer

Use appendPQExpBufferStr when there are no parameters and
appendPQExpBufferChar when the string length is 1.

Unlike 3fae25cbb, which fixed this issue for code that was new to v18,
this one fixes up instances which exist in the backbranches. We've
historically tried to maintain this standard and if we're going to
continue doing that, then we won't be doing that selectively based on
when the code was introduced. Now seems like a good time to flush out the
existing misuses. Waiting until v19 just prolongs their existence in
terms of released versions that the misuses exist in.

Author: David Rowley <drowleyml(at)gmail(dot)com>
Discussion: https://postgr.es/m/CAApHDvoARMvPeXTTC0HnpARBHn-WgVstc8XFCyMGOzvgu_1HvQ@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/1bd08f6ba56ac9b23dc46ab634d82327395e882e

Modified Files
--------------
src/bin/initdb/initdb.c | 4 ++--
src/bin/pg_basebackup/pg_createsubscriber.c | 24 ++++++++++++------------
src/bin/pg_dump/pg_dump.c | 24 ++++++++++++------------
src/bin/pg_dump/pg_dumpall.c | 2 +-
src/bin/pg_upgrade/pg_upgrade.c | 8 ++++----
src/bin/psql/common.c | 2 +-
src/bin/scripts/vacuumdb.c | 16 ++++++++--------
7 files changed, 40 insertions(+), 40 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tatsuo Ishii 2025-04-18 00:39:42 pgsql: Doc: fix missing comma at the end of a line.
Previous Message David Rowley 2025-04-17 21:04:52 pgsql: Make levels 1-based in pg_log_backend_memory_contexts()