Replace some appendStringInfo* calls with more appropriate variants
authorPeter Eisentraut <peter_e@gmx.net>
Tue, 12 May 2015 00:38:55 +0000 (20:38 -0400)
committerPeter Eisentraut <peter_e@gmx.net>
Tue, 12 May 2015 00:38:55 +0000 (20:38 -0400)
Author: David Rowley <dgrowleyml@gmail.com>

contrib/postgres_fdw/postgres_fdw.c
contrib/test_decoding/test_decoding.c
src/backend/access/rmgrdesc/smgrdesc.c
src/backend/access/rmgrdesc/xlogdesc.c
src/backend/catalog/namespace.c
src/backend/utils/adt/ruleutils.c

index ec89b25f61a7ab8b4d9fe793821f5999e622d644..0c442608426d2bef489d4361b5540634e47e9662 100644 (file)
@@ -2734,7 +2734,7 @@ postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
                                        appendStringInfoString(&buf, ", ");
                                deparseStringLiteral(&buf, rv->relname);
                        }
-                       appendStringInfoString(&buf, ")");
+                       appendStringInfoChar(&buf, ')');
                }
 
                /* Append ORDER BY at the end of query to ensure output ordering */
@@ -2798,7 +2798,7 @@ postgresImportForeignSchema(ImportForeignSchemaStmt *stmt, Oid serverOid)
                                 */
                                appendStringInfoString(&buf, " OPTIONS (column_name ");
                                deparseStringLiteral(&buf, attname);
-                               appendStringInfoString(&buf, ")");
+                               appendStringInfoChar(&buf, ')');
 
                                /* Add COLLATE if needed */
                                if (import_collate && collname != NULL && collnamespace != NULL)
index bca03ee21b4a8f26821eb6a6899b39dbd51d12ba..ae2aca8a8db35c78fb4b4735a2fa70a45d8c2579 100644 (file)
@@ -419,7 +419,7 @@ pg_decode_change(LogicalDecodingContext *ctx, ReorderBufferTXN *txn,
                                                                                                          get_namespace_name(
                                                          get_rel_namespace(RelationGetRelid(relation))),
                                                                                          NameStr(class_form->relname)));
-       appendStringInfoString(ctx->out, ":");
+       appendStringInfoChar(ctx->out, ':');
 
        switch (change->action)
        {
index 4ae08b1988cc7d7c13b82b7c4bf3932e8907c0d5..56d02c325c6e364b674dd9df90bdee6db91c470d 100644 (file)
@@ -29,7 +29,7 @@ smgr_desc(StringInfo buf, XLogReaderState *record)
                xl_smgr_create *xlrec = (xl_smgr_create *) rec;
                char       *path = relpathperm(xlrec->rnode, xlrec->forkNum);
 
-               appendStringInfo(buf, "%s", path);
+               appendStringInfoString(buf, path);
                pfree(path);
        }
        else if (info == XLOG_SMGR_TRUNCATE)
index 2c432f3e2a8b1b7d87933051ab47b739a6e9c643..4f2913683a1a228b355c194ed45652e646c9ed88 100644 (file)
@@ -75,7 +75,7 @@ xlog_desc(StringInfo buf, XLogReaderState *record)
        {
                xl_restore_point *xlrec = (xl_restore_point *) rec;
 
-               appendStringInfo(buf, "%s", xlrec->rp_name);
+               appendStringInfoString(buf, xlrec->rp_name);
        }
        else if (info == XLOG_FPI || info == XLOG_FPI_FOR_HINT)
        {
@@ -125,7 +125,7 @@ xlog_desc(StringInfo buf, XLogReaderState *record)
                bool            fpw;
 
                memcpy(&fpw, rec, sizeof(bool));
-               appendStringInfo(buf, "%s", fpw ? "true" : "false");
+               appendStringInfoString(buf, fpw ? "true" : "false");
        }
        else if (info == XLOG_END_OF_RECOVERY)
        {
index 2f6d697d8263692b96ea9c87a2833de5590ca313..b16af64bb3d9d71221ca17b69b0ce0ccc19c14c5 100644 (file)
@@ -2937,7 +2937,7 @@ NameListToString(List *names)
                if (IsA(name, String))
                        appendStringInfoString(&string, strVal(name));
                else if (IsA(name, A_Star))
-                       appendStringInfoString(&string, "*");
+                       appendStringInfoChar(&string, '*');
                else
                        elog(ERROR, "unexpected node type in name list: %d",
                                 (int) nodeTag(name));
index 156b5331f36fb1965c3185770b9a23ddbc0028e7..903e80aea35275984112e1badc3fc5b246de7337 100644 (file)
@@ -2174,7 +2174,7 @@ print_function_rettype(StringInfo buf, HeapTuple proctup)
                appendStringInfoString(&rbuf, "TABLE(");
                ntabargs = print_function_arguments(&rbuf, proctup, true, false);
                if (ntabargs > 0)
-                       appendStringInfoString(&rbuf, ")");
+                       appendStringInfoChar(&rbuf, ')');
                else
                        resetStringInfo(&rbuf);
        }