Replace some appendStringInfo* calls with more appropriate variants

Author: David Rowley <dgrowleyml@gmail.com>
pull/14/head
Peter Eisentraut 10 years ago
parent b488c580ae
commit d02f16470f
  1. 4
      contrib/postgres_fdw/postgres_fdw.c
  2. 2
      contrib/test_decoding/test_decoding.c
  3. 2
      src/backend/access/rmgrdesc/smgrdesc.c
  4. 4
      src/backend/access/rmgrdesc/xlogdesc.c
  5. 2
      src/backend/catalog/namespace.c
  6. 2
      src/backend/utils/adt/ruleutils.c

@ -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)

@ -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)
{

@ -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)

@ -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)
{

@ -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));

@ -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);
}

Loading…
Cancel
Save