diff options
| author | Heikki Linnakangas | 2015-07-02 09:32:48 +0000 |
|---|---|---|
| committer | Heikki Linnakangas | 2015-07-02 09:36:03 +0000 |
| commit | f92d6a540ac443f85f0929b284edff67da14687a (patch) | |
| tree | 3c7e4d5d882889255b7e6b19e1343e37fa812e03 /src/bin | |
| parent | 7931622d1d942dbbba8d0eab77f18f69f1ce5de0 (diff) | |
Use appendStringInfoString/Char et al where appropriate.
Patch by David Rowley. Backpatch to 9.5, as some of the calls were new in
9.5, and keeping the code in sync with master makes future backpatching
easier.
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/pg_basebackup/pg_basebackup.c | 2 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_backup_archiver.c | 2 | ||||
| -rw-r--r-- | src/bin/pg_dump/pg_dump.c | 6 | ||||
| -rw-r--r-- | src/bin/psql/describe.c | 8 | ||||
| -rw-r--r-- | src/bin/scripts/clusterdb.c | 2 | ||||
| -rw-r--r-- | src/bin/scripts/createdb.c | 4 | ||||
| -rw-r--r-- | src/bin/scripts/createuser.c | 2 | ||||
| -rw-r--r-- | src/bin/scripts/reindexdb.c | 2 | ||||
| -rw-r--r-- | src/bin/scripts/vacuumdb.c | 4 |
9 files changed, 16 insertions, 16 deletions
diff --git a/src/bin/pg_basebackup/pg_basebackup.c b/src/bin/pg_basebackup/pg_basebackup.c index 5dd2887d12e..536368020b0 100644 --- a/src/bin/pg_basebackup/pg_basebackup.c +++ b/src/bin/pg_basebackup/pg_basebackup.c @@ -1516,7 +1516,7 @@ GenerateRecoveryConf(PGconn *conn) /* Separate key-value pairs with spaces */ if (conninfo_buf.len != 0) - appendPQExpBufferStr(&conninfo_buf, " "); + appendPQExpBufferChar(&conninfo_buf, ' '); /* * Write "keyword=value" pieces, the value string is escaped and/or diff --git a/src/bin/pg_dump/pg_backup_archiver.c b/src/bin/pg_dump/pg_backup_archiver.c index f9b564eee41..0d52babc4f1 100644 --- a/src/bin/pg_dump/pg_backup_archiver.c +++ b/src/bin/pg_dump/pg_backup_archiver.c @@ -533,7 +533,7 @@ RestoreArchive(Archive *AHX) * search for hardcoded "DROP CONSTRAINT" instead. */ if (strcmp(te->desc, "DEFAULT") == 0) - appendPQExpBuffer(ftStmt, "%s", dropStmt); + appendPQExpBufferStr(ftStmt, dropStmt); else { if (strcmp(te->desc, "CONSTRAINT") == 0 || diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index a72dfe93da9..0a8129020bd 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -1659,7 +1659,7 @@ dumpTableData_insert(Archive *fout, DumpOptions *dopt, void *dcontext) /* append the list of column names if required */ if (dopt->column_inserts) { - appendPQExpBufferStr(insertStmt, "("); + appendPQExpBufferChar(insertStmt, '('); for (field = 0; field < nfields; field++) { if (field > 0) @@ -11332,7 +11332,7 @@ dumpOpclass(Archive *fout, DumpOptions *dopt, OpclassInfo *opcinfo) appendPQExpBufferStr(q, " FAMILY "); if (strcmp(opcfamilynsp, opcinfo->dobj.namespace->dobj.name) != 0) appendPQExpBuffer(q, "%s.", fmtId(opcfamilynsp)); - appendPQExpBuffer(q, "%s", fmtId(opcfamilyname)); + appendPQExpBufferStr(q, fmtId(opcfamilyname)); } appendPQExpBufferStr(q, " AS\n "); @@ -13844,7 +13844,7 @@ dumpTableSchema(Archive *fout, DumpOptions *dopt, TableInfo *tbinfo) if (actual_atts == 0) appendPQExpBufferStr(q, " ("); else - appendPQExpBufferStr(q, ","); + appendPQExpBufferChar(q, ','); appendPQExpBufferStr(q, "\n "); actual_atts++; diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index db568096dce..f63c7e90d3c 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -1611,7 +1611,7 @@ describeOneTableDetails(const char *schemaname, if (!PQgetisnull(res, i, 5)) { if (tmpbuf.len > 0) - appendPQExpBufferStr(&tmpbuf, " "); + appendPQExpBufferChar(&tmpbuf, ' '); appendPQExpBuffer(&tmpbuf, _("collate %s"), PQgetvalue(res, i, 5)); } @@ -1619,7 +1619,7 @@ describeOneTableDetails(const char *schemaname, if (strcmp(PQgetvalue(res, i, 3), "t") == 0) { if (tmpbuf.len > 0) - appendPQExpBufferStr(&tmpbuf, " "); + appendPQExpBufferChar(&tmpbuf, ' '); appendPQExpBufferStr(&tmpbuf, _("not null")); } @@ -1628,7 +1628,7 @@ describeOneTableDetails(const char *schemaname, if (strlen(PQgetvalue(res, i, 2)) != 0) { if (tmpbuf.len > 0) - appendPQExpBufferStr(&tmpbuf, " "); + appendPQExpBufferChar(&tmpbuf, ' '); /* translator: default values of column definitions */ appendPQExpBuffer(&tmpbuf, _("default %s"), PQgetvalue(res, i, 2)); @@ -2440,7 +2440,7 @@ describeOneTableDetails(const char *schemaname, printfPQExpBuffer(&buf, "%*s %s", sw, "", PQgetvalue(result, i, 0)); if (i < tuples - 1) - appendPQExpBufferStr(&buf, ","); + appendPQExpBufferChar(&buf, ','); printTableAddFooter(&cont, buf.data); } diff --git a/src/bin/scripts/clusterdb.c b/src/bin/scripts/clusterdb.c index 85087af7956..8c0e7cfab28 100644 --- a/src/bin/scripts/clusterdb.c +++ b/src/bin/scripts/clusterdb.c @@ -201,7 +201,7 @@ cluster_one_database(const char *dbname, bool verbose, const char *table, appendPQExpBufferStr(&sql, " VERBOSE"); if (table) appendPQExpBuffer(&sql, " %s", table); - appendPQExpBufferStr(&sql, ";"); + appendPQExpBufferChar(&sql, ';'); conn = connectDatabase(dbname, host, port, username, prompt_password, progname, false); diff --git a/src/bin/scripts/createdb.c b/src/bin/scripts/createdb.c index a958bb86f01..4d3fb22622a 100644 --- a/src/bin/scripts/createdb.c +++ b/src/bin/scripts/createdb.c @@ -195,7 +195,7 @@ main(int argc, char *argv[]) if (lc_ctype) appendPQExpBuffer(&sql, " LC_CTYPE '%s'", lc_ctype); - appendPQExpBufferStr(&sql, ";"); + appendPQExpBufferChar(&sql, ';'); /* No point in trying to use postgres db when creating postgres db. */ if (maintenance_db == NULL && strcmp(dbname, "postgres") == 0) @@ -222,7 +222,7 @@ main(int argc, char *argv[]) { printfPQExpBuffer(&sql, "COMMENT ON DATABASE %s IS ", fmtId(dbname)); appendStringLiteralConn(&sql, comment, conn); - appendPQExpBufferStr(&sql, ";"); + appendPQExpBufferChar(&sql, ';'); if (echo) printf("%s\n", sql.data); diff --git a/src/bin/scripts/createuser.c b/src/bin/scripts/createuser.c index fba21a1c659..c8bcf0d0b2e 100644 --- a/src/bin/scripts/createuser.c +++ b/src/bin/scripts/createuser.c @@ -321,7 +321,7 @@ main(int argc, char *argv[]) appendPQExpBuffer(&sql, "%s", fmtId(cell->val)); } } - appendPQExpBufferStr(&sql, ";"); + appendPQExpBufferChar(&sql, ';'); if (echo) printf("%s\n", sql.data); diff --git a/src/bin/scripts/reindexdb.c b/src/bin/scripts/reindexdb.c index 941729da2e7..80c78860bee 100644 --- a/src/bin/scripts/reindexdb.c +++ b/src/bin/scripts/reindexdb.c @@ -295,7 +295,7 @@ reindex_one_database(const char *name, const char *dbname, const char *type, appendPQExpBuffer(&sql, " SCHEMA %s", name); else if (strcmp(type, "DATABASE") == 0) appendPQExpBuffer(&sql, " DATABASE %s", fmtId(name)); - appendPQExpBufferStr(&sql, ";"); + appendPQExpBufferChar(&sql, ';'); conn = connectDatabase(dbname, host, port, username, prompt_password, progname, false); diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c index f600b0514a8..ca6d0036832 100644 --- a/src/bin/scripts/vacuumdb.c +++ b/src/bin/scripts/vacuumdb.c @@ -392,7 +392,7 @@ vacuum_one_database(const char *dbname, vacuumingOptions *vacopts, ntups = PQntuples(res); for (i = 0; i < ntups; i++) { - appendPQExpBuffer(&buf, "%s", + appendPQExpBufferStr(&buf, fmtQualifiedId(PQserverVersion(conn), PQgetvalue(res, i, 1), PQgetvalue(res, i, 0))); @@ -643,7 +643,7 @@ prepare_vacuum_command(PQExpBuffer sql, PGconn *conn, vacuumingOptions *vacopts, sep = comma; } if (sep != paren) - appendPQExpBufferStr(sql, ")"); + appendPQExpBufferChar(sql, ')'); } else { |
