diff options
author | Peter Eisentraut <peter_e@gmx.net> | 2017-08-15 23:34:39 -0400 |
---|---|---|
committer | Peter Eisentraut <peter_e@gmx.net> | 2017-08-15 23:34:39 -0400 |
commit | 77d05706beb115b412728bd94dce16d83795583d (patch) | |
tree | d1154b7ff7b438d7ecd15b2d0bbd9c5b50086a18 /src/bin | |
parent | 4d4c89171598424b31175ef9b600ac87a9a61023 (diff) | |
download | postgresql-77d05706beb115b412728bd94dce16d83795583d.tar.gz postgresql-77d05706beb115b412728bd94dce16d83795583d.zip |
Fix up some misusage of appendStringInfo() and friends
Change to appendStringInfoChar() or appendStringInfoString() where those
can be used.
Author: David Rowley <david.rowley@2ndquadrant.com>
Reviewed-by: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
Diffstat (limited to 'src/bin')
-rw-r--r-- | src/bin/pg_dump/pg_dump.c | 5 | ||||
-rw-r--r-- | src/bin/pg_dump/pg_dumpall.c | 2 | ||||
-rw-r--r-- | src/bin/psql/command.c | 4 | ||||
-rw-r--r-- | src/bin/psql/describe.c | 2 | ||||
-rw-r--r-- | src/bin/scripts/createuser.c | 2 |
5 files changed, 7 insertions, 8 deletions
diff --git a/src/bin/pg_dump/pg_dump.c b/src/bin/pg_dump/pg_dump.c index 628bdea1fd4..b6e66267ffc 100644 --- a/src/bin/pg_dump/pg_dump.c +++ b/src/bin/pg_dump/pg_dump.c @@ -15424,7 +15424,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo) if (tbinfo->ispartition && !dopt->binary_upgrade) { - appendPQExpBufferStr(q, "\n"); + appendPQExpBufferChar(q, '\n'); appendPQExpBufferStr(q, tbinfo->partbound); } @@ -17127,8 +17127,7 @@ dumpRule(Archive *fout, RuleInfo *rinfo) appendPQExpBuffer(delcmd, "CREATE OR REPLACE VIEW %s.", fmtId(tbinfo->dobj.namespace->dobj.name)); - appendPQExpBuffer(delcmd, "%s", - fmtId(tbinfo->dobj.name)); + appendPQExpBufferStr(delcmd, fmtId(tbinfo->dobj.name)); result = createDummyViewAsClause(fout, tbinfo); appendPQExpBuffer(delcmd, " AS\n%s;\n", result->data); destroyPQExpBuffer(result); diff --git a/src/bin/pg_dump/pg_dumpall.c b/src/bin/pg_dump/pg_dumpall.c index c0a0346cd9c..806b537e64f 100644 --- a/src/bin/pg_dump/pg_dumpall.c +++ b/src/bin/pg_dump/pg_dumpall.c @@ -1575,7 +1575,7 @@ dumpDatabaseConfig(PGconn *conn, const char *dbname) appendStringLiteralConn(buf, dbname, conn); if (server_version >= 90000) - appendPQExpBuffer(buf, ")"); + appendPQExpBufferChar(buf, ')'); res = executeQuery(conn, buf->data); if (PQntuples(res) == 1 && diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c index 4e04459d45e..96f3a402a40 100644 --- a/src/bin/psql/command.c +++ b/src/bin/psql/command.c @@ -4676,7 +4676,7 @@ get_create_object_cmd(EditableObjectType obj_type, Oid oid, psql_error("could not parse reloptions array\n"); result = false; } - appendPQExpBufferStr(buf, ")"); + appendPQExpBufferChar(buf, ')'); } /* View definition from pg_get_viewdef (a SELECT query) */ @@ -4862,7 +4862,7 @@ minimal_error_message(PGresult *res) appendPQExpBufferStr(msg, fld); else appendPQExpBufferStr(msg, "(not available)"); - appendPQExpBufferStr(msg, "\n"); + appendPQExpBufferChar(msg, '\n'); psql_error("%s", msg->data); diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 798e71045fd..f6049cc9e5c 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3177,7 +3177,7 @@ describeRoles(const char *pattern, bool verbose, bool showSystem) if (strcmp(PQgetvalue(res, i, 7), "") != 0) { if (buf.len > 0) - appendPQExpBufferStr(&buf, "\n"); + appendPQExpBufferChar(&buf, '\n'); appendPQExpBufferStr(&buf, _("Password valid until ")); appendPQExpBufferStr(&buf, PQgetvalue(res, i, 7)); } diff --git a/src/bin/scripts/createuser.c b/src/bin/scripts/createuser.c index d88093f8b6e..0e36edcc5d1 100644 --- a/src/bin/scripts/createuser.c +++ b/src/bin/scripts/createuser.c @@ -313,7 +313,7 @@ main(int argc, char *argv[]) if (cell->next) appendPQExpBuffer(&sql, "%s,", fmtId(cell->val)); else - appendPQExpBuffer(&sql, "%s", fmtId(cell->val)); + appendPQExpBufferStr(&sql, fmtId(cell->val)); } } appendPQExpBufferChar(&sql, ';'); |