diff --git a/src/bin/pg_basebackup/pg_createsubscriber.c b/src/bin/pg_basebackup/pg_createsubscriber.c index 42aaa428aed..b92a978a426 100644 --- a/src/bin/pg_basebackup/pg_createsubscriber.c +++ b/src/bin/pg_basebackup/pg_createsubscriber.c @@ -1487,7 +1487,7 @@ start_standby_server(const struct CreateSubscriberOptions *opt, bool restricted_ appendPQExpBuffer(pg_ctl_cmd, " -s -o \"-c sync_replication_slots=off\""); /* Prevent unintended slot invalidation */ - appendPQExpBuffer(pg_ctl_cmd, " -o \"-c idle_replication_slot_timeout=0\""); + appendPQExpBufferStr(pg_ctl_cmd, " -o \"-c idle_replication_slot_timeout=0\""); if (restricted_access) { @@ -1513,7 +1513,7 @@ start_standby_server(const struct CreateSubscriberOptions *opt, bool restricted_ /* Suppress to start logical replication if requested */ if (restrict_logical_worker) - appendPQExpBuffer(pg_ctl_cmd, " -o \"-c max_logical_replication_workers=0\""); + appendPQExpBufferStr(pg_ctl_cmd, " -o \"-c max_logical_replication_workers=0\""); pg_log_debug("pg_ctl command is: %s", pg_ctl_cmd->data); rc = system(pg_ctl_cmd->data); diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index b158d96a831..8ef9c6a021a 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -9751,7 +9751,7 @@ determineNotNullFlags(Archive *fout, PGresult *res, int r, { *invalidnotnulloids = createPQExpBuffer(); appendPQExpBufferChar(*invalidnotnulloids, '{'); - appendPQExpBuffer(*invalidnotnulloids, "%s", constroid); + appendPQExpBufferStr(*invalidnotnulloids, constroid); } else appendPQExpBuffer(*invalidnotnulloids, ",%s", constroid); @@ -10978,7 +10978,7 @@ dumpRelationStats_dumper(Archive *fout, const void *userArg, const TocEntry *te) */ if (rsinfo->nindAttNames == 0) { - appendPQExpBuffer(out, ",\n\t'attname', "); + appendPQExpBufferStr(out, ",\n\t'attname', "); appendStringLiteralAH(out, attname, fout); } else diff --git a/src/interfaces/libpq/fe-auth-oauth-curl.c b/src/interfaces/libpq/fe-auth-oauth-curl.c index cd9c0323bb6..ddd87dcf02d 100644 --- a/src/interfaces/libpq/fe-auth-oauth-curl.c +++ b/src/interfaces/libpq/fe-auth-oauth-curl.c @@ -2859,7 +2859,7 @@ error_return: } } - appendPQExpBufferStr(&conn->errorMessage, "\n"); + appendPQExpBufferChar(&conn->errorMessage, '\n'); return PGRES_POLLING_FAILED; } diff --git a/src/test/modules/test_escape/test_escape.c b/src/test/modules/test_escape/test_escape.c index f6b36448977..0b4883cc7c8 100644 --- a/src/test/modules/test_escape/test_escape.c +++ b/src/test/modules/test_escape/test_escape.c @@ -96,8 +96,7 @@ escape_literal(PGconn *conn, PQExpBuffer target, escaped = PQescapeLiteral(conn, unescaped, unescaped_len); if (!escaped) { - appendPQExpBuffer(escape_err, "%s", - PQerrorMessage(conn)); + appendPQExpBufferStr(escape_err, PQerrorMessage(conn)); escape_err->data[escape_err->len - 1] = 0; escape_err->len--; return false; @@ -120,8 +119,7 @@ escape_identifier(PGconn *conn, PQExpBuffer target, escaped = PQescapeIdentifier(conn, unescaped, unescaped_len); if (!escaped) { - appendPQExpBuffer(escape_err, "%s", - PQerrorMessage(conn)); + appendPQExpBufferStr(escape_err, PQerrorMessage(conn)); escape_err->data[escape_err->len - 1] = 0; escape_err->len--; return false; @@ -153,8 +151,7 @@ escape_string_conn(PGconn *conn, PQExpBuffer target, if (error) { - appendPQExpBuffer(escape_err, "%s", - PQerrorMessage(conn)); + appendPQExpBufferStr(escape_err, PQerrorMessage(conn)); escape_err->data[escape_err->len - 1] = 0; escape_err->len--; return false; @@ -514,7 +511,7 @@ test_psql_parse(pe_test_config *tc, PQExpBuffer testname, "#\t\t %d: scan_result: %s prompt: %u, query_buf: ", matches, scan_res_s(scan_result), prompt_status); escapify(details, query_buf->data, query_buf->len); - appendPQExpBuffer(details, "\n"); + appendPQExpBufferChar(details, '\n'); matches++; } @@ -566,7 +563,7 @@ test_one_vector_escape(pe_test_config *tc, const pe_test_vector *tv, const pe_te } /* name to describe the test */ - appendPQExpBuffer(testname, ">"); + appendPQExpBufferChar(testname, '>'); escapify(testname, tv->escape, tv->escape_len); appendPQExpBuffer(testname, "< - %s - %s", tv->client_encoding, ef->name); @@ -575,7 +572,7 @@ test_one_vector_escape(pe_test_config *tc, const pe_test_vector *tv, const pe_te appendPQExpBuffer(details, "#\t input: %zd bytes: ", tv->escape_len); escapify(details, tv->escape, tv->escape_len); - appendPQExpBufferStr(details, "\n"); + appendPQExpBufferChar(details, '\n'); appendPQExpBuffer(details, "#\t encoding: %s\n", tv->client_encoding);