diff options
| author | David Rowley | 2024-04-09 23:53:32 +0000 |
|---|---|---|
| committer | David Rowley | 2024-04-09 23:53:32 +0000 |
| commit | 8461424fd717877ead0706984ef9b6440b2a97ad (patch) | |
| tree | ac5ee13afb549d4f44830d8ac6d08d846e1c1b74 /src/backend/replication | |
| parent | ff9f72c68f678ded340b431c3e280fe56644a3e7 (diff) | |
Fixup various StringInfo function usages
This adjusts various appendStringInfo* function calls to use a more
appropriate and efficient function with the same behavior. For example,
use appendStringInfoChar() when appending a single character rather than
appendStringInfo() and appendStringInfoString() when no formatting is
required rather than using appendStringInfo().
All adjustments made here are in code that's new to v17, so it makes
sense to fix these now rather than wait a few years and make
backpatching harder.
Discussion: https://postgr.es/m/CAApHDvojY2UvMiO+9_55ArTj10P1LBNJyyoGB+C65BLDNT0GsQ@mail.gmail.com
Reviewed-by: Nathan Bossart, Tom Lane
Diffstat (limited to 'src/backend/replication')
| -rw-r--r-- | src/backend/replication/logical/slotsync.c | 2 | ||||
| -rw-r--r-- | src/backend/replication/logical/tablesync.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/replication/logical/slotsync.c b/src/backend/replication/logical/slotsync.c index d18e2c7342a..97440cb6bf0 100644 --- a/src/backend/replication/logical/slotsync.c +++ b/src/backend/replication/logical/slotsync.c @@ -1311,7 +1311,7 @@ ReplSlotSyncWorkerMain(char *startup_data, size_t startup_data_len) if (cluster_name[0]) appendStringInfo(&app_name, "%s_%s", cluster_name, "slotsync worker"); else - appendStringInfo(&app_name, "%s", "slotsync worker"); + appendStringInfoString(&app_name, "slotsync worker"); /* * Establish the connection to the primary server for slot diff --git a/src/backend/replication/logical/tablesync.c b/src/backend/replication/logical/tablesync.c index 1061d5b61b3..f1a3ad54595 100644 --- a/src/backend/replication/logical/tablesync.c +++ b/src/backend/replication/logical/tablesync.c @@ -1154,7 +1154,7 @@ copy_table(Relation rel) appendStringInfoString(&cmd, quote_identifier(lrel.attnames[i])); } - appendStringInfoString(&cmd, ")"); + appendStringInfoChar(&cmd, ')'); } appendStringInfoString(&cmd, " TO STDOUT"); |
