Use appendStringInfoString instead of appendStringInfo where possible.

This shaves a few cycles, and generally seems like good programming
practice.

David Rowley
This commit is contained in:
Robert Haas 2013-10-31 10:55:59 -04:00
parent 343bb134ea
commit cacbdd7810
33 changed files with 399 additions and 404 deletions

View File

@ -335,18 +335,18 @@ cube_out(PG_FUNCTION_ARGS)
for (i = 0; i < dim; i++)
{
if (i > 0)
appendStringInfo(&buf, ", ");
appendStringInfoString(&buf, ", ");
appendStringInfo(&buf, "%.*g", ndig, LL_COORD(cube, i));
}
appendStringInfoChar(&buf, ')');
if (!cube_is_point_internal(cube))
{
appendStringInfo(&buf, ",(");
appendStringInfoString(&buf, ",(");
for (i = 0; i < dim; i++)
{
if (i > 0)
appendStringInfo(&buf, ", ");
appendStringInfoString(&buf, ", ");
appendStringInfo(&buf, "%.*g", ndig, UR_COORD(cube, i));
}
appendStringInfoChar(&buf, ')');

View File

@ -2169,14 +2169,14 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
continue;
if (needComma)
appendStringInfo(&buf, ",");
appendStringInfoChar(&buf, ',');
appendStringInfoString(&buf,
quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname)));
needComma = true;
}
appendStringInfo(&buf, ") VALUES(");
appendStringInfoString(&buf, ") VALUES(");
/*
* Note: i is physical column number (counting from 0).
@ -2188,7 +2188,7 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
continue;
if (needComma)
appendStringInfo(&buf, ",");
appendStringInfoChar(&buf, ',');
key = get_attnum_pk_pos(pkattnums, pknumatts, i);
@ -2203,10 +2203,10 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
pfree(val);
}
else
appendStringInfo(&buf, "NULL");
appendStringInfoString(&buf, "NULL");
needComma = true;
}
appendStringInfo(&buf, ")");
appendStringInfoChar(&buf, ')');
return (buf.data);
}
@ -2232,7 +2232,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals
int pkattnum = pkattnums[i];
if (i > 0)
appendStringInfo(&buf, " AND ");
appendStringInfoString(&buf, " AND ");
appendStringInfoString(&buf,
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
@ -2241,7 +2241,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals
appendStringInfo(&buf, " = %s",
quote_literal_cstr(tgt_pkattvals[i]));
else
appendStringInfo(&buf, " IS NULL");
appendStringInfoString(&buf, " IS NULL");
}
return (buf.data);
@ -2286,7 +2286,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
continue;
if (needComma)
appendStringInfo(&buf, ", ");
appendStringInfoString(&buf, ", ");
appendStringInfo(&buf, "%s = ",
quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname)));
@ -2308,16 +2308,16 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
needComma = true;
}
appendStringInfo(&buf, " WHERE ");
appendStringInfoString(&buf, " WHERE ");
for (i = 0; i < pknumatts; i++)
{
int pkattnum = pkattnums[i];
if (i > 0)
appendStringInfo(&buf, " AND ");
appendStringInfoString(&buf, " AND ");
appendStringInfo(&buf, "%s",
appendStringInfoString(&buf,
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
val = tgt_pkattvals[i];
@ -2325,7 +2325,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
if (val != NULL)
appendStringInfo(&buf, " = %s", quote_literal_cstr(val));
else
appendStringInfo(&buf, " IS NULL");
appendStringInfoString(&buf, " IS NULL");
}
return (buf.data);
@ -2419,7 +2419,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
int pkattnum = pkattnums[i];
if (i > 0)
appendStringInfo(&buf, " AND ");
appendStringInfoString(&buf, " AND ");
appendStringInfoString(&buf,
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
@ -2428,7 +2428,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
appendStringInfo(&buf, " = %s",
quote_literal_cstr(src_pkattvals[i]));
else
appendStringInfo(&buf, " IS NULL");
appendStringInfoString(&buf, " IS NULL");
}
/*

View File

@ -1972,7 +1972,7 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
initStringInfo(&buf);
appendStringInfo(&buf, "\ndigraph sourceNFA {\n");
appendStringInfoString(&buf, "\ndigraph sourceNFA {\n");
for (state = 0; state < nstates; state++)
{
@ -1982,8 +1982,8 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
appendStringInfo(&buf, "s%d", state);
if (pg_reg_getfinalstate(regex) == state)
appendStringInfo(&buf, " [shape = doublecircle]");
appendStringInfo(&buf, ";\n");
appendStringInfoString(&buf, " [shape = doublecircle]");
appendStringInfoString(&buf, ";\n");
arcsCount = pg_reg_getnumoutarcs(regex, state);
arcs = (regex_arc_t *) palloc(sizeof(regex_arc_t) * arcsCount);
@ -1998,13 +1998,13 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
pfree(arcs);
}
appendStringInfo(&buf, " node [shape = point ]; initial;\n");
appendStringInfoString(&buf, " node [shape = point ]; initial;\n");
appendStringInfo(&buf, " initial -> s%d;\n",
pg_reg_getinitialstate(regex));
/* Print colors */
appendStringInfo(&buf, " { rank = sink;\n");
appendStringInfo(&buf, " Colors [shape = none, margin=0, label=<\n");
appendStringInfoString(&buf, " { rank = sink;\n");
appendStringInfoString(&buf, " Colors [shape = none, margin=0, label=<\n");
for (i = 0; i < ncolors; i++)
{
@ -2020,17 +2020,17 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
memcpy(s, color->wordChars[j].bytes, MAX_MULTIBYTE_CHAR_LEN);
s[MAX_MULTIBYTE_CHAR_LEN] = '\0';
appendStringInfo(&buf, "%s", s);
appendStringInfoString(&buf, s);
}
}
else
appendStringInfo(&buf, "not expandable");
appendStringInfo(&buf, "\n");
appendStringInfoString(&buf, "not expandable");
appendStringInfoChar(&buf, '\n');
}
appendStringInfo(&buf, " >];\n");
appendStringInfo(&buf, " }\n");
appendStringInfo(&buf, "}\n");
appendStringInfoString(&buf, " >];\n");
appendStringInfoString(&buf, " }\n");
appendStringInfoString(&buf, "}\n");
{
/* dot -Tpng -o /tmp/source.png < /tmp/source.dot */
@ -2056,7 +2056,7 @@ printTrgmNFA(TrgmNFA *trgmNFA)
initStringInfo(&buf);
appendStringInfo(&buf, "\ndigraph transformedNFA {\n");
appendStringInfoString(&buf, "\ndigraph transformedNFA {\n");
hash_seq_init(&scan_status, trgmNFA->states);
while ((state = (TrgmState *) hash_seq_search(&scan_status)) != NULL)
@ -2065,11 +2065,11 @@ printTrgmNFA(TrgmNFA *trgmNFA)
appendStringInfo(&buf, "s%p", (void *) state);
if (state->fin)
appendStringInfo(&buf, " [shape = doublecircle]");
appendStringInfoString(&buf, " [shape = doublecircle]");
if (state->init)
initstate = state;
appendStringInfo(&buf, " [label = \"%d\"]", state->stateKey.nstate);
appendStringInfo(&buf, ";\n");
appendStringInfoString(&buf, ";\n");
foreach(cell, state->arcs)
{
@ -2078,21 +2078,21 @@ printTrgmNFA(TrgmNFA *trgmNFA)
appendStringInfo(&buf, " s%p -> s%p [label = \"",
(void *) state, (void *) arc->target);
printTrgmColor(&buf, arc->ctrgm.colors[0]);
appendStringInfo(&buf, " ");
appendStringInfoChar(&buf, ' ');
printTrgmColor(&buf, arc->ctrgm.colors[1]);
appendStringInfo(&buf, " ");
appendStringInfoChar(&buf, ' ');
printTrgmColor(&buf, arc->ctrgm.colors[2]);
appendStringInfo(&buf, "\"];\n");
appendStringInfoString(&buf, "\"];\n");
}
}
if (initstate)
{
appendStringInfo(&buf, " node [shape = point ]; initial;\n");
appendStringInfoString(&buf, " node [shape = point ]; initial;\n");
appendStringInfo(&buf, " initial -> s%p;\n", (void *) initstate);
}
appendStringInfo(&buf, "}\n");
appendStringInfoString(&buf, "}\n");
{
/* dot -Tpng -o /tmp/transformed.png < /tmp/transformed.dot */
@ -2112,9 +2112,9 @@ static void
printTrgmColor(StringInfo buf, TrgmColor co)
{
if (co == COLOR_UNKNOWN)
appendStringInfo(buf, "u");
appendStringInfoChar(buf, 'u');
else if (co == COLOR_BLANK)
appendStringInfo(buf, "b");
appendStringInfoChar(buf, 'b');
else
appendStringInfo(buf, "%d", (int) co);
}
@ -2131,7 +2131,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
initStringInfo(&buf);
appendStringInfo(&buf, "\ndigraph packedGraph {\n");
appendStringInfoString(&buf, "\ndigraph packedGraph {\n");
for (i = 0; i < packedGraph->statesCount; i++)
{
@ -2140,7 +2140,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
appendStringInfo(&buf, " s%d", i);
if (i == 1)
appendStringInfo(&buf, " [shape = doublecircle]");
appendStringInfoString(&buf, " [shape = doublecircle]");
appendStringInfo(&buf, " [label = <s%d>];\n", i);
@ -2153,12 +2153,12 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
}
}
appendStringInfo(&buf, " node [shape = point ]; initial;\n");
appendStringInfoString(&buf, " node [shape = point ]; initial;\n");
appendStringInfo(&buf, " initial -> s%d;\n", 0);
/* Print trigrams */
appendStringInfo(&buf, " { rank = sink;\n");
appendStringInfo(&buf, " Trigrams [shape = none, margin=0, label=<\n");
appendStringInfoString(&buf, " { rank = sink;\n");
appendStringInfoString(&buf, " Trigrams [shape = none, margin=0, label=<\n");
p = GETARR(trigrams);
for (i = 0; i < packedGraph->colorTrigramsCount; i++)
@ -2171,7 +2171,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
for (j = 0; j < count; j++)
{
if (j > 0)
appendStringInfo(&buf, ", ");
appendStringInfoString(&buf, ", ");
/*
* XXX This representation is nice only for all-ASCII trigrams.
@ -2181,9 +2181,9 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
}
}
appendStringInfo(&buf, " >];\n");
appendStringInfo(&buf, " }\n");
appendStringInfo(&buf, "}\n");
appendStringInfoString(&buf, " >];\n");
appendStringInfoString(&buf, " }\n");
appendStringInfoString(&buf, "}\n");
{
/* dot -Tpng -o /tmp/packed.png < /tmp/packed.dot */

View File

@ -841,7 +841,7 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root,
if (targetAttrs)
{
appendStringInfoString(buf, "(");
appendStringInfoChar(buf, '(');
first = true;
foreach(lc, targetAttrs)
@ -869,7 +869,7 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root,
pindex++;
}
appendStringInfoString(buf, ")");
appendStringInfoChar(buf, ')');
}
else
appendStringInfoString(buf, " DEFAULT VALUES");
@ -989,7 +989,7 @@ deparseAnalyzeSizeSql(StringInfo buf, Relation rel)
initStringInfo(&relname);
deparseRelation(&relname, rel);
appendStringInfo(buf, "SELECT pg_catalog.pg_relation_size(");
appendStringInfoString(buf, "SELECT pg_catalog.pg_relation_size(");
deparseStringLiteral(buf, relname.data);
appendStringInfo(buf, "::pg_catalog.regclass) / %d", BLCKSZ);
}
@ -1302,7 +1302,7 @@ deparseConst(Const *node, deparse_expr_cxt *context)
if (node->constisnull)
{
appendStringInfo(buf, "NULL");
appendStringInfoString(buf, "NULL");
appendStringInfo(buf, "::%s",
format_type_with_typemod(node->consttype,
node->consttypmod));
@ -1650,7 +1650,7 @@ deparseOperatorName(StringInfo buf, Form_pg_operator opform)
else
{
/* Just print operator name. */
appendStringInfo(buf, "%s", opname);
appendStringInfoString(buf, opname);
}
}

View File

@ -787,7 +787,7 @@ postgresGetForeignPlan(PlannerInfo *root,
root->parse->commandType == CMD_DELETE))
{
/* Relation is UPDATE/DELETE target, so use FOR UPDATE */
appendStringInfo(&sql, " FOR UPDATE");
appendStringInfoString(&sql, " FOR UPDATE");
}
else
{
@ -808,11 +808,11 @@ postgresGetForeignPlan(PlannerInfo *root,
{
case LCS_FORKEYSHARE:
case LCS_FORSHARE:
appendStringInfo(&sql, " FOR SHARE");
appendStringInfoString(&sql, " FOR SHARE");
break;
case LCS_FORNOKEYUPDATE:
case LCS_FORUPDATE:
appendStringInfo(&sql, " FOR UPDATE");
appendStringInfoString(&sql, " FOR UPDATE");
break;
}
}

View File

@ -1340,7 +1340,7 @@ build_tuplestore_recursively(char *key_fld,
for (i = 0; i < proc; i++)
{
/* initialize branch for this pass */
appendStringInfo(&branchstr, "%s", branch);
appendStringInfoString(&branchstr, branch);
appendStringInfo(&chk_branchstr, "%s%s%s", branch_delim, branch, branch_delim);
/* get the next sql result tuple */

View File

@ -37,5 +37,5 @@ clog_desc(StringInfo buf, uint8 xl_info, char *rec)
appendStringInfo(buf, "truncate before: %d", pageno);
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -39,5 +39,5 @@ dbase_desc(StringInfo buf, uint8 xl_info, char *rec)
xlrec->db_id, xlrec->tablespace_id);
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -33,15 +33,15 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
switch (info)
{
case XLOG_GIN_CREATE_INDEX:
appendStringInfo(buf, "Create index, ");
appendStringInfoString(buf, "Create index, ");
desc_node(buf, *(RelFileNode *) rec, GIN_ROOT_BLKNO);
break;
case XLOG_GIN_CREATE_PTREE:
appendStringInfo(buf, "Create posting tree, ");
appendStringInfoString(buf, "Create posting tree, ");
desc_node(buf, ((ginxlogCreatePostingTree *) rec)->node, ((ginxlogCreatePostingTree *) rec)->blkno);
break;
case XLOG_GIN_INSERT:
appendStringInfo(buf, "Insert item, ");
appendStringInfoString(buf, "Insert item, ");
desc_node(buf, ((ginxlogInsert *) rec)->node, ((ginxlogInsert *) rec)->blkno);
appendStringInfo(buf, " offset: %u nitem: %u isdata: %c isleaf %c isdelete %c updateBlkno:%u",
((ginxlogInsert *) rec)->offset,
@ -52,24 +52,24 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
((ginxlogInsert *) rec)->updateBlkno);
break;
case XLOG_GIN_SPLIT:
appendStringInfo(buf, "Page split, ");
appendStringInfoString(buf, "Page split, ");
desc_node(buf, ((ginxlogSplit *) rec)->node, ((ginxlogSplit *) rec)->lblkno);
appendStringInfo(buf, " isrootsplit: %c", (((ginxlogSplit *) rec)->isRootSplit) ? 'T' : 'F');
break;
case XLOG_GIN_VACUUM_PAGE:
appendStringInfo(buf, "Vacuum page, ");
appendStringInfoString(buf, "Vacuum page, ");
desc_node(buf, ((ginxlogVacuumPage *) rec)->node, ((ginxlogVacuumPage *) rec)->blkno);
break;
case XLOG_GIN_DELETE_PAGE:
appendStringInfo(buf, "Delete page, ");
appendStringInfoString(buf, "Delete page, ");
desc_node(buf, ((ginxlogDeletePage *) rec)->node, ((ginxlogDeletePage *) rec)->blkno);
break;
case XLOG_GIN_UPDATE_META_PAGE:
appendStringInfo(buf, "Update metapage, ");
appendStringInfoString(buf, "Update metapage, ");
desc_node(buf, ((ginxlogUpdateMeta *) rec)->node, GIN_METAPAGE_BLKNO);
break;
case XLOG_GIN_INSERT_LISTPAGE:
appendStringInfo(buf, "Insert new list page, ");
appendStringInfoString(buf, "Insert new list page, ");
desc_node(buf, ((ginxlogInsertListPage *) rec)->node, ((ginxlogInsertListPage *) rec)->blkno);
break;
case XLOG_GIN_DELETE_LISTPAGE:

View File

@ -35,7 +35,7 @@ out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec)
static void
out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec)
{
appendStringInfo(buf, "page_split: ");
appendStringInfoString(buf, "page_split: ");
out_target(buf, xlrec->node);
appendStringInfo(buf, "; block number %u splits to %d pages",
xlrec->origblkno, xlrec->npage);
@ -49,7 +49,7 @@ gist_desc(StringInfo buf, uint8 xl_info, char *rec)
switch (info)
{
case XLOG_GIST_PAGE_UPDATE:
appendStringInfo(buf, "page_update: ");
appendStringInfoString(buf, "page_update: ");
out_gistxlogPageUpdate(buf, (gistxlogPageUpdate *) rec);
break;
case XLOG_GIST_PAGE_SPLIT:

View File

@ -29,15 +29,15 @@ static void
out_infobits(StringInfo buf, uint8 infobits)
{
if (infobits & XLHL_XMAX_IS_MULTI)
appendStringInfo(buf, "IS_MULTI ");
appendStringInfoString(buf, "IS_MULTI ");
if (infobits & XLHL_XMAX_LOCK_ONLY)
appendStringInfo(buf, "LOCK_ONLY ");
appendStringInfoString(buf, "LOCK_ONLY ");
if (infobits & XLHL_XMAX_EXCL_LOCK)
appendStringInfo(buf, "EXCL_LOCK ");
appendStringInfoString(buf, "EXCL_LOCK ");
if (infobits & XLHL_XMAX_KEYSHR_LOCK)
appendStringInfo(buf, "KEYSHR_LOCK ");
appendStringInfoString(buf, "KEYSHR_LOCK ");
if (infobits & XLHL_KEYS_UPDATED)
appendStringInfo(buf, "KEYS_UPDATED ");
appendStringInfoString(buf, "KEYS_UPDATED ");
}
void
@ -51,16 +51,16 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_heap_insert *xlrec = (xl_heap_insert *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE)
appendStringInfo(buf, "insert(init): ");
appendStringInfoString(buf, "insert(init): ");
else
appendStringInfo(buf, "insert: ");
appendStringInfoString(buf, "insert: ");
out_target(buf, &(xlrec->target));
}
else if (info == XLOG_HEAP_DELETE)
{
xl_heap_delete *xlrec = (xl_heap_delete *) rec;
appendStringInfo(buf, "delete: ");
appendStringInfoString(buf, "delete: ");
out_target(buf, &(xlrec->target));
appendStringInfoChar(buf, ' ');
out_infobits(buf, xlrec->infobits_set);
@ -70,9 +70,9 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_heap_update *xlrec = (xl_heap_update *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE)
appendStringInfo(buf, "update(init): ");
appendStringInfoString(buf, "update(init): ");
else
appendStringInfo(buf, "update: ");
appendStringInfoString(buf, "update: ");
out_target(buf, &(xlrec->target));
appendStringInfo(buf, " xmax %u ", xlrec->old_xmax);
out_infobits(buf, xlrec->old_infobits_set);
@ -86,9 +86,9 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_heap_update *xlrec = (xl_heap_update *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE) /* can this case happen? */
appendStringInfo(buf, "hot_update(init): ");
appendStringInfoString(buf, "hot_update(init): ");
else
appendStringInfo(buf, "hot_update: ");
appendStringInfoString(buf, "hot_update: ");
out_target(buf, &(xlrec->target));
appendStringInfo(buf, " xmax %u ", xlrec->old_xmax);
out_infobits(buf, xlrec->old_infobits_set);
@ -119,11 +119,11 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_heap_inplace *xlrec = (xl_heap_inplace *) rec;
appendStringInfo(buf, "inplace: ");
appendStringInfoString(buf, "inplace: ");
out_target(buf, &(xlrec->target));
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}
void
heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
@ -169,9 +169,9 @@ heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_heap_multi_insert *xlrec = (xl_heap_multi_insert *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE)
appendStringInfo(buf, "multi-insert (init): ");
appendStringInfoString(buf, "multi-insert (init): ");
else
appendStringInfo(buf, "multi-insert: ");
appendStringInfoString(buf, "multi-insert: ");
appendStringInfo(buf, "rel %u/%u/%u; blk %u; %d tuples",
xlrec->node.spcNode, xlrec->node.dbNode, xlrec->node.relNode,
xlrec->blkno, xlrec->ntuples);
@ -185,5 +185,5 @@ heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
out_target(buf, &(xlrec->target));
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -76,5 +76,5 @@ multixact_desc(StringInfo buf, uint8 xl_info, char *rec)
out_member(buf, &xlrec->members[i]);
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -36,7 +36,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_btree_insert *xlrec = (xl_btree_insert *) rec;
appendStringInfo(buf, "insert: ");
appendStringInfoString(buf, "insert: ");
out_target(buf, &(xlrec->target));
break;
}
@ -44,7 +44,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_btree_insert *xlrec = (xl_btree_insert *) rec;
appendStringInfo(buf, "insert_upper: ");
appendStringInfoString(buf, "insert_upper: ");
out_target(buf, &(xlrec->target));
break;
}
@ -52,7 +52,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_btree_insert *xlrec = (xl_btree_insert *) rec;
appendStringInfo(buf, "insert_meta: ");
appendStringInfoString(buf, "insert_meta: ");
out_target(buf, &(xlrec->target));
break;
}
@ -130,7 +130,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_btree_delete_page *xlrec = (xl_btree_delete_page *) rec;
appendStringInfo(buf, "delete_page: ");
appendStringInfoString(buf, "delete_page: ");
out_target(buf, &(xlrec->target));
appendStringInfo(buf, "; dead %u; left %u; right %u",
xlrec->deadblk, xlrec->leftblk, xlrec->rightblk);
@ -156,7 +156,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
break;
}
default:
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
break;
}
}

View File

@ -29,5 +29,5 @@ relmap_desc(StringInfo buf, uint8 xl_info, char *rec)
xlrec->dbid, xlrec->tsid, xlrec->nbytes);
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -24,10 +24,10 @@ seq_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_seq_rec *xlrec = (xl_seq_rec *) rec;
if (info == XLOG_SEQ_LOG)
appendStringInfo(buf, "log: ");
appendStringInfoString(buf, "log: ");
else
{
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
return;
}

View File

@ -42,5 +42,5 @@ smgr_desc(StringInfo buf, uint8 xl_info, char *rec)
pfree(path);
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -64,7 +64,7 @@ spg_desc(StringInfo buf, uint8 xl_info, char *rec)
break;
case XLOG_SPGIST_PICKSPLIT:
out_target(buf, ((spgxlogPickSplit *) rec)->node);
appendStringInfo(buf, "split leaf page");
appendStringInfoString(buf, "split leaf page");
break;
case XLOG_SPGIST_VACUUM_LEAF:
out_target(buf, ((spgxlogVacuumLeaf *) rec)->node);

View File

@ -33,7 +33,7 @@ standby_desc_running_xacts(StringInfo buf, xl_running_xacts *xlrec)
}
if (xlrec->subxid_overflow)
appendStringInfo(buf, "; subxid ovf");
appendStringInfoString(buf, "; subxid ovf");
}
void
@ -46,7 +46,7 @@ standby_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_standby_locks *xlrec = (xl_standby_locks *) rec;
int i;
appendStringInfo(buf, "AccessExclusive locks:");
appendStringInfoString(buf, "AccessExclusive locks:");
for (i = 0; i < xlrec->nlocks; i++)
appendStringInfo(buf, " xid %u db %u rel %u",
@ -57,9 +57,9 @@ standby_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_running_xacts *xlrec = (xl_running_xacts *) rec;
appendStringInfo(buf, "running xacts:");
appendStringInfoString(buf, "running xacts:");
standby_desc_running_xacts(buf, xlrec);
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -36,5 +36,5 @@ tblspc_desc(StringInfo buf, uint8 xl_info, char *rec)
appendStringInfo(buf, "drop tablespace: %u", xlrec->ts_id);
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -33,7 +33,7 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
if (xlrec->nrels > 0)
{
appendStringInfo(buf, "; rels:");
appendStringInfoString(buf, "; rels:");
for (i = 0; i < xlrec->nrels; i++)
{
char *path = relpathperm(xlrec->xnodes[i], MAIN_FORKNUM);
@ -44,7 +44,7 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
}
if (xlrec->nsubxacts > 0)
{
appendStringInfo(buf, "; subxacts:");
appendStringInfoString(buf, "; subxacts:");
for (i = 0; i < xlrec->nsubxacts; i++)
appendStringInfo(buf, " %u", subxacts[i]);
}
@ -58,7 +58,7 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
appendStringInfo(buf, "; relcache init file inval dbid %u tsid %u",
xlrec->dbId, xlrec->tsId);
appendStringInfo(buf, "; inval msgs:");
appendStringInfoString(buf, "; inval msgs:");
for (i = 0; i < xlrec->nmsgs; i++)
{
SharedInvalidationMessage *msg = &msgs[i];
@ -71,10 +71,10 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
appendStringInfo(buf, " relcache %u", msg->rc.relId);
/* not expected, but print something anyway */
else if (msg->id == SHAREDINVALSMGR_ID)
appendStringInfo(buf, " smgr");
appendStringInfoString(buf, " smgr");
/* not expected, but print something anyway */
else if (msg->id == SHAREDINVALRELMAP_ID)
appendStringInfo(buf, " relmap");
appendStringInfoString(buf, " relmap");
else if (msg->id == SHAREDINVALSNAPSHOT_ID)
appendStringInfo(buf, " snapshot %u", msg->sn.relId);
else
@ -92,7 +92,7 @@ xact_desc_commit_compact(StringInfo buf, xl_xact_commit_compact *xlrec)
if (xlrec->nsubxacts > 0)
{
appendStringInfo(buf, "; subxacts:");
appendStringInfoString(buf, "; subxacts:");
for (i = 0; i < xlrec->nsubxacts; i++)
appendStringInfo(buf, " %u", xlrec->subxacts[i]);
}
@ -106,7 +106,7 @@ xact_desc_abort(StringInfo buf, xl_xact_abort *xlrec)
appendStringInfoString(buf, timestamptz_to_str(xlrec->xact_time));
if (xlrec->nrels > 0)
{
appendStringInfo(buf, "; rels:");
appendStringInfoString(buf, "; rels:");
for (i = 0; i < xlrec->nrels; i++)
{
char *path = relpathperm(xlrec->xnodes[i], MAIN_FORKNUM);
@ -120,7 +120,7 @@ xact_desc_abort(StringInfo buf, xl_xact_abort *xlrec)
TransactionId *xacts = (TransactionId *)
&xlrec->xnodes[xlrec->nrels];
appendStringInfo(buf, "; subxacts:");
appendStringInfoString(buf, "; subxacts:");
for (i = 0; i < xlrec->nsubxacts; i++)
appendStringInfo(buf, " %u", xacts[i]);
}
@ -131,7 +131,7 @@ xact_desc_assignment(StringInfo buf, xl_xact_assignment *xlrec)
{
int i;
appendStringInfo(buf, "subxacts:");
appendStringInfoString(buf, "subxacts:");
for (i = 0; i < xlrec->nsubxacts; i++)
appendStringInfo(buf, " %u", xlrec->xsub[i]);
@ -146,26 +146,26 @@ xact_desc(StringInfo buf, uint8 xl_info, char *rec)
{
xl_xact_commit_compact *xlrec = (xl_xact_commit_compact *) rec;
appendStringInfo(buf, "commit: ");
appendStringInfoString(buf, "commit: ");
xact_desc_commit_compact(buf, xlrec);
}
else if (info == XLOG_XACT_COMMIT)
{
xl_xact_commit *xlrec = (xl_xact_commit *) rec;
appendStringInfo(buf, "commit: ");
appendStringInfoString(buf, "commit: ");
xact_desc_commit(buf, xlrec);
}
else if (info == XLOG_XACT_ABORT)
{
xl_xact_abort *xlrec = (xl_xact_abort *) rec;
appendStringInfo(buf, "abort: ");
appendStringInfoString(buf, "abort: ");
xact_desc_abort(buf, xlrec);
}
else if (info == XLOG_XACT_PREPARE)
{
appendStringInfo(buf, "prepare");
appendStringInfoString(buf, "prepare");
}
else if (info == XLOG_XACT_COMMIT_PREPARED)
{
@ -194,5 +194,5 @@ xact_desc(StringInfo buf, uint8 xl_info, char *rec)
xact_desc_assignment(buf, xlrec);
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -62,7 +62,7 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec)
}
else if (info == XLOG_NOOP)
{
appendStringInfo(buf, "xlog no-op");
appendStringInfoString(buf, "xlog no-op");
}
else if (info == XLOG_NEXTOID)
{
@ -73,7 +73,7 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec)
}
else if (info == XLOG_SWITCH)
{
appendStringInfo(buf, "xlog switch");
appendStringInfoString(buf, "xlog switch");
}
else if (info == XLOG_RESTORE_POINT)
{
@ -141,5 +141,5 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec)
timestamptz_to_str(xlrec.end_time));
}
else
appendStringInfo(buf, "UNKNOWN");
appendStringInfoString(buf, "UNKNOWN");
}

View File

@ -1248,7 +1248,7 @@ begin:;
xlog_outrec(&buf, rechdr);
if (rdata->data != NULL)
{
appendStringInfo(&buf, " - ");
appendStringInfoString(&buf, " - ");
RmgrTable[rechdr->xl_rmid].rm_desc(&buf, rechdr->xl_info, rdata->data);
}
elog(LOG, "%s", buf.data);
@ -6677,7 +6677,7 @@ StartupXLOG(void)
(uint32) (ReadRecPtr >> 32), (uint32) ReadRecPtr,
(uint32) (EndRecPtr >> 32), (uint32) EndRecPtr);
xlog_outrec(&buf, record);
appendStringInfo(&buf, " - ");
appendStringInfoString(&buf, " - ");
RmgrTable[record->xl_rmid].rm_desc(&buf,
record->xl_info,
XLogRecGetData(record));

View File

@ -2439,15 +2439,15 @@ getObjectTypeDescription(const ObjectAddress *object)
break;
case OCLASS_TYPE:
appendStringInfo(&buffer, "type");
appendStringInfoString(&buffer, "type");
break;
case OCLASS_CAST:
appendStringInfo(&buffer, "cast");
appendStringInfoString(&buffer, "cast");
break;
case OCLASS_COLLATION:
appendStringInfo(&buffer, "collation");
appendStringInfoString(&buffer, "collation");
break;
case OCLASS_CONSTRAINT:
@ -2455,103 +2455,103 @@ getObjectTypeDescription(const ObjectAddress *object)
break;
case OCLASS_CONVERSION:
appendStringInfo(&buffer, "conversion");
appendStringInfoString(&buffer, "conversion");
break;
case OCLASS_DEFAULT:
appendStringInfo(&buffer, "default value");
appendStringInfoString(&buffer, "default value");
break;
case OCLASS_LANGUAGE:
appendStringInfo(&buffer, "language");
appendStringInfoString(&buffer, "language");
break;
case OCLASS_LARGEOBJECT:
appendStringInfo(&buffer, "large object");
appendStringInfoString(&buffer, "large object");
break;
case OCLASS_OPERATOR:
appendStringInfo(&buffer, "operator");
appendStringInfoString(&buffer, "operator");
break;
case OCLASS_OPCLASS:
appendStringInfo(&buffer, "operator class");
appendStringInfoString(&buffer, "operator class");
break;
case OCLASS_OPFAMILY:
appendStringInfo(&buffer, "operator family");
appendStringInfoString(&buffer, "operator family");
break;
case OCLASS_AMOP:
appendStringInfo(&buffer, "operator of access method");
appendStringInfoString(&buffer, "operator of access method");
break;
case OCLASS_AMPROC:
appendStringInfo(&buffer, "function of access method");
appendStringInfoString(&buffer, "function of access method");
break;
case OCLASS_REWRITE:
appendStringInfo(&buffer, "rule");
appendStringInfoString(&buffer, "rule");
break;
case OCLASS_TRIGGER:
appendStringInfo(&buffer, "trigger");
appendStringInfoString(&buffer, "trigger");
break;
case OCLASS_SCHEMA:
appendStringInfo(&buffer, "schema");
appendStringInfoString(&buffer, "schema");
break;
case OCLASS_TSPARSER:
appendStringInfo(&buffer, "text search parser");
appendStringInfoString(&buffer, "text search parser");
break;
case OCLASS_TSDICT:
appendStringInfo(&buffer, "text search dictionary");
appendStringInfoString(&buffer, "text search dictionary");
break;
case OCLASS_TSTEMPLATE:
appendStringInfo(&buffer, "text search template");
appendStringInfoString(&buffer, "text search template");
break;
case OCLASS_TSCONFIG:
appendStringInfo(&buffer, "text search configuration");
appendStringInfoString(&buffer, "text search configuration");
break;
case OCLASS_ROLE:
appendStringInfo(&buffer, "role");
appendStringInfoString(&buffer, "role");
break;
case OCLASS_DATABASE:
appendStringInfo(&buffer, "database");
appendStringInfoString(&buffer, "database");
break;
case OCLASS_TBLSPACE:
appendStringInfo(&buffer, "tablespace");
appendStringInfoString(&buffer, "tablespace");
break;
case OCLASS_FDW:
appendStringInfo(&buffer, "foreign-data wrapper");
appendStringInfoString(&buffer, "foreign-data wrapper");
break;
case OCLASS_FOREIGN_SERVER:
appendStringInfo(&buffer, "server");
appendStringInfoString(&buffer, "server");
break;
case OCLASS_USER_MAPPING:
appendStringInfo(&buffer, "user mapping");
appendStringInfoString(&buffer, "user mapping");
break;
case OCLASS_DEFACL:
appendStringInfo(&buffer, "default acl");
appendStringInfoString(&buffer, "default acl");
break;
case OCLASS_EXTENSION:
appendStringInfo(&buffer, "extension");
appendStringInfoString(&buffer, "extension");
break;
case OCLASS_EVENT_TRIGGER:
appendStringInfo(&buffer, "event trigger");
appendStringInfoString(&buffer, "event trigger");
break;
default:
@ -2580,37 +2580,37 @@ getRelationTypeDescription(StringInfo buffer, Oid relid, int32 objectSubId)
switch (relForm->relkind)
{
case RELKIND_RELATION:
appendStringInfo(buffer, "table");
appendStringInfoString(buffer, "table");
break;
case RELKIND_INDEX:
appendStringInfo(buffer, "index");
appendStringInfoString(buffer, "index");
break;
case RELKIND_SEQUENCE:
appendStringInfo(buffer, "sequence");
appendStringInfoString(buffer, "sequence");
break;
case RELKIND_TOASTVALUE:
appendStringInfo(buffer, "toast table");
appendStringInfoString(buffer, "toast table");
break;
case RELKIND_VIEW:
appendStringInfo(buffer, "view");
appendStringInfoString(buffer, "view");
break;
case RELKIND_MATVIEW:
appendStringInfo(buffer, "materialized view");
appendStringInfoString(buffer, "materialized view");
break;
case RELKIND_COMPOSITE_TYPE:
appendStringInfo(buffer, "composite type");
appendStringInfoString(buffer, "composite type");
break;
case RELKIND_FOREIGN_TABLE:
appendStringInfo(buffer, "foreign table");
appendStringInfoString(buffer, "foreign table");
break;
default:
/* shouldn't get here */
appendStringInfo(buffer, "relation");
appendStringInfoString(buffer, "relation");
break;
}
if (objectSubId != 0)
appendStringInfo(buffer, " column");
appendStringInfoString(buffer, " column");
ReleaseSysCache(relTup);
}
@ -2658,9 +2658,9 @@ getProcedureTypeDescription(StringInfo buffer, Oid procid)
procForm = (Form_pg_proc) GETSTRUCT(procTup);
if (procForm->proisagg)
appendStringInfo(buffer, "aggregate");
appendStringInfoString(buffer, "aggregate");
else
appendStringInfo(buffer, "function");
appendStringInfoString(buffer, "function");
ReleaseSysCache(procTup);
}
@ -2693,12 +2693,12 @@ getObjectIdentity(const ObjectAddress *object)
break;
case OCLASS_PROC:
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
format_procedure_qualified(object->objectId));
break;
case OCLASS_TYPE:
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
format_type_be_qualified(object->objectId));
break;
@ -2792,7 +2792,7 @@ getObjectIdentity(const ObjectAddress *object)
elog(ERROR, "cache lookup failed for conversion %u",
object->objectId);
conForm = (Form_pg_conversion) GETSTRUCT(conTup);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(NameStr(conForm->conname)));
ReleaseSysCache(conTup);
break;
@ -2849,7 +2849,7 @@ getObjectIdentity(const ObjectAddress *object)
elog(ERROR, "cache lookup failed for language %u",
object->objectId);
langForm = (Form_pg_language) GETSTRUCT(langTup);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(NameStr(langForm->lanname)));
ReleaseSysCache(langTup);
break;
@ -2860,7 +2860,7 @@ getObjectIdentity(const ObjectAddress *object)
break;
case OCLASS_OPERATOR:
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
format_operator_qualified(object->objectId));
break;
@ -2887,8 +2887,7 @@ getObjectIdentity(const ObjectAddress *object)
opcForm->opcmethod);
amForm = (Form_pg_am) GETSTRUCT(amTup);
appendStringInfo(&buffer,
"%s",
appendStringInfoString(&buffer,
quote_qualified_identifier(schema,
NameStr(opcForm->opcname)));
appendStringInfo(&buffer, " for %s",
@ -3047,7 +3046,7 @@ getObjectIdentity(const ObjectAddress *object)
if (!nspname)
elog(ERROR, "cache lookup failed for namespace %u",
object->objectId);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(nspname));
break;
}
@ -3063,7 +3062,7 @@ getObjectIdentity(const ObjectAddress *object)
elog(ERROR, "cache lookup failed for text search parser %u",
object->objectId);
formParser = (Form_pg_ts_parser) GETSTRUCT(tup);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(NameStr(formParser->prsname)));
ReleaseSysCache(tup);
break;
@ -3080,7 +3079,7 @@ getObjectIdentity(const ObjectAddress *object)
elog(ERROR, "cache lookup failed for text search dictionary %u",
object->objectId);
formDict = (Form_pg_ts_dict) GETSTRUCT(tup);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(NameStr(formDict->dictname)));
ReleaseSysCache(tup);
break;
@ -3097,7 +3096,7 @@ getObjectIdentity(const ObjectAddress *object)
elog(ERROR, "cache lookup failed for text search template %u",
object->objectId);
formTmpl = (Form_pg_ts_template) GETSTRUCT(tup);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(NameStr(formTmpl->tmplname)));
ReleaseSysCache(tup);
break;
@ -3114,7 +3113,7 @@ getObjectIdentity(const ObjectAddress *object)
elog(ERROR, "cache lookup failed for text search configuration %u",
object->objectId);
formCfg = (Form_pg_ts_config) GETSTRUCT(tup);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(NameStr(formCfg->cfgname)));
ReleaseSysCache(tup);
break;
@ -3125,7 +3124,7 @@ getObjectIdentity(const ObjectAddress *object)
char *username;
username = GetUserNameFromId(object->objectId);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(username));
break;
}
@ -3138,7 +3137,7 @@ getObjectIdentity(const ObjectAddress *object)
if (!datname)
elog(ERROR, "cache lookup failed for database %u",
object->objectId);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(datname));
break;
}
@ -3151,7 +3150,7 @@ getObjectIdentity(const ObjectAddress *object)
if (!tblspace)
elog(ERROR, "cache lookup failed for tablespace %u",
object->objectId);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(tblspace));
break;
}
@ -3161,8 +3160,7 @@ getObjectIdentity(const ObjectAddress *object)
ForeignDataWrapper *fdw;
fdw = GetForeignDataWrapper(object->objectId);
appendStringInfo(&buffer, "%s",
quote_identifier(fdw->fdwname));
appendStringInfoString(&buffer, quote_identifier(fdw->fdwname));
break;
}
@ -3171,7 +3169,7 @@ getObjectIdentity(const ObjectAddress *object)
ForeignServer *srv;
srv = GetForeignServer(object->objectId);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(srv->servername));
break;
}
@ -3197,7 +3195,7 @@ getObjectIdentity(const ObjectAddress *object)
else
usename = "public";
appendStringInfo(&buffer, "%s", usename);
appendStringInfoString(&buffer, usename);
break;
}
@ -3275,8 +3273,7 @@ getObjectIdentity(const ObjectAddress *object)
if (!extname)
elog(ERROR, "cache lookup failed for extension %u",
object->objectId);
appendStringInfo(&buffer, "%s",
quote_identifier(extname));
appendStringInfoString(&buffer, quote_identifier(extname));
break;
}
@ -3291,7 +3288,7 @@ getObjectIdentity(const ObjectAddress *object)
elog(ERROR, "cache lookup failed for event trigger %u",
object->objectId);
trigForm = (Form_pg_event_trigger) GETSTRUCT(tup);
appendStringInfo(&buffer, "%s",
appendStringInfoString(&buffer,
quote_identifier(NameStr(trigForm->evtname)));
ReleaseSysCache(tup);
break;
@ -3356,7 +3353,7 @@ getRelationIdentity(StringInfo buffer, Oid relid)
relForm = (Form_pg_class) GETSTRUCT(relTup);
schema = get_namespace_name(relForm->relnamespace);
appendStringInfo(buffer, "%s",
appendStringInfoString(buffer,
quote_qualified_identifier(schema,
NameStr(relForm->relname)));

View File

@ -1087,7 +1087,7 @@ ExplainNode(PlanState *planstate, List *ancestors,
if (((Join *) plan)->jointype != JOIN_INNER)
appendStringInfo(es->str, " %s Join", jointype);
else if (!IsA(plan, NestLoop))
appendStringInfo(es->str, " Join");
appendStringInfoString(es->str, " Join");
}
else
ExplainPropertyText("Join Type", jointype, es);
@ -1182,7 +1182,7 @@ ExplainNode(PlanState *planstate, List *ancestors,
{
if (es->format == EXPLAIN_FORMAT_TEXT)
appendStringInfo(es->str, " (never executed)");
appendStringInfoString(es->str, " (never executed)");
else if (planstate->instrument->need_timer)
{
ExplainPropertyFloat("Actual Startup Time", 0.0, 3, es);

View File

@ -1523,7 +1523,7 @@ serialize_deflist(List *deflist)
}
appendStringInfoChar(&buf, '\'');
if (lnext(l) != NULL)
appendStringInfo(&buf, ", ");
appendStringInfoString(&buf, ", ");
}
result = cstring_to_text_with_len(buf.data, buf.len);

View File

@ -111,7 +111,7 @@ _outToken(StringInfo str, const char *s)
{
if (s == NULL || *s == '\0')
{
appendStringInfo(str, "<>");
appendStringInfoString(str, "<>");
return;
}
@ -214,19 +214,19 @@ _outDatum(StringInfo str, Datum value, int typlen, bool typbyval)
appendStringInfo(str, "%u [ ", (unsigned int) length);
for (i = 0; i < (Size) sizeof(Datum); i++)
appendStringInfo(str, "%d ", (int) (s[i]));
appendStringInfo(str, "]");
appendStringInfoChar(str, ']');
}
else
{
s = (char *) DatumGetPointer(value);
if (!PointerIsValid(s))
appendStringInfo(str, "0 [ ]");
appendStringInfoString(str, "0 [ ]");
else
{
appendStringInfo(str, "%u [ ", (unsigned int) length);
for (i = 0; i < length; i++)
appendStringInfo(str, "%d ", (int) (s[i]));
appendStringInfo(str, "]");
appendStringInfoChar(str, ']');
}
}
}
@ -362,19 +362,19 @@ _outMergeAppend(StringInfo str, const MergeAppend *node)
WRITE_INT_FIELD(numCols);
appendStringInfo(str, " :sortColIdx");
appendStringInfoString(str, " :sortColIdx");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %d", node->sortColIdx[i]);
appendStringInfo(str, " :sortOperators");
appendStringInfoString(str, " :sortOperators");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %u", node->sortOperators[i]);
appendStringInfo(str, " :collations");
appendStringInfoString(str, " :collations");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %u", node->collations[i]);
appendStringInfo(str, " :nullsFirst");
appendStringInfoString(str, " :nullsFirst");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %s", booltostr(node->nullsFirst[i]));
}
@ -391,11 +391,11 @@ _outRecursiveUnion(StringInfo str, const RecursiveUnion *node)
WRITE_INT_FIELD(wtParam);
WRITE_INT_FIELD(numCols);
appendStringInfo(str, " :dupColIdx");
appendStringInfoString(str, " :dupColIdx");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %d", node->dupColIdx[i]);
appendStringInfo(str, " :dupOperators");
appendStringInfoString(str, " :dupOperators");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %u", node->dupOperators[i]);
@ -599,19 +599,19 @@ _outMergeJoin(StringInfo str, const MergeJoin *node)
numCols = list_length(node->mergeclauses);
appendStringInfo(str, " :mergeFamilies");
appendStringInfoString(str, " :mergeFamilies");
for (i = 0; i < numCols; i++)
appendStringInfo(str, " %u", node->mergeFamilies[i]);
appendStringInfo(str, " :mergeCollations");
appendStringInfoString(str, " :mergeCollations");
for (i = 0; i < numCols; i++)
appendStringInfo(str, " %u", node->mergeCollations[i]);
appendStringInfo(str, " :mergeStrategies");
appendStringInfoString(str, " :mergeStrategies");
for (i = 0; i < numCols; i++)
appendStringInfo(str, " %d", node->mergeStrategies[i]);
appendStringInfo(str, " :mergeNullsFirst");
appendStringInfoString(str, " :mergeNullsFirst");
for (i = 0; i < numCols; i++)
appendStringInfo(str, " %d", (int) node->mergeNullsFirst[i]);
}
@ -638,11 +638,11 @@ _outAgg(StringInfo str, const Agg *node)
WRITE_ENUM_FIELD(aggstrategy, AggStrategy);
WRITE_INT_FIELD(numCols);
appendStringInfo(str, " :grpColIdx");
appendStringInfoString(str, " :grpColIdx");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %d", node->grpColIdx[i]);
appendStringInfo(str, " :grpOperators");
appendStringInfoString(str, " :grpOperators");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %u", node->grpOperators[i]);
@ -661,21 +661,21 @@ _outWindowAgg(StringInfo str, const WindowAgg *node)
WRITE_UINT_FIELD(winref);
WRITE_INT_FIELD(partNumCols);
appendStringInfo(str, " :partColIdx");
appendStringInfoString(str, " :partColIdx");
for (i = 0; i < node->partNumCols; i++)
appendStringInfo(str, " %d", node->partColIdx[i]);
appendStringInfo(str, " :partOperations");
appendStringInfoString(str, " :partOperations");
for (i = 0; i < node->partNumCols; i++)
appendStringInfo(str, " %u", node->partOperators[i]);
WRITE_INT_FIELD(ordNumCols);
appendStringInfo(str, " :ordColIdx");
appendStringInfoString(str, " :ordColIdx");
for (i = 0; i < node->ordNumCols; i++)
appendStringInfo(str, " %d", node->ordColIdx[i]);
appendStringInfo(str, " :ordOperations");
appendStringInfoString(str, " :ordOperations");
for (i = 0; i < node->ordNumCols; i++)
appendStringInfo(str, " %u", node->ordOperators[i]);
@ -695,11 +695,11 @@ _outGroup(StringInfo str, const Group *node)
WRITE_INT_FIELD(numCols);
appendStringInfo(str, " :grpColIdx");
appendStringInfoString(str, " :grpColIdx");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %d", node->grpColIdx[i]);
appendStringInfo(str, " :grpOperators");
appendStringInfoString(str, " :grpOperators");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %u", node->grpOperators[i]);
}
@ -723,19 +723,19 @@ _outSort(StringInfo str, const Sort *node)
WRITE_INT_FIELD(numCols);
appendStringInfo(str, " :sortColIdx");
appendStringInfoString(str, " :sortColIdx");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %d", node->sortColIdx[i]);
appendStringInfo(str, " :sortOperators");
appendStringInfoString(str, " :sortOperators");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %u", node->sortOperators[i]);
appendStringInfo(str, " :collations");
appendStringInfoString(str, " :collations");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %u", node->collations[i]);
appendStringInfo(str, " :nullsFirst");
appendStringInfoString(str, " :nullsFirst");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %s", booltostr(node->nullsFirst[i]));
}
@ -751,11 +751,11 @@ _outUnique(StringInfo str, const Unique *node)
WRITE_INT_FIELD(numCols);
appendStringInfo(str, " :uniqColIdx");
appendStringInfoString(str, " :uniqColIdx");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %d", node->uniqColIdx[i]);
appendStringInfo(str, " :uniqOperators");
appendStringInfoString(str, " :uniqOperators");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %u", node->uniqOperators[i]);
}
@ -787,11 +787,11 @@ _outSetOp(StringInfo str, const SetOp *node)
WRITE_ENUM_FIELD(strategy, SetOpStrategy);
WRITE_INT_FIELD(numCols);
appendStringInfo(str, " :dupColIdx");
appendStringInfoString(str, " :dupColIdx");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %d", node->dupColIdx[i]);
appendStringInfo(str, " :dupOperators");
appendStringInfoString(str, " :dupOperators");
for (i = 0; i < node->numCols; i++)
appendStringInfo(str, " %u", node->dupOperators[i]);
@ -928,9 +928,9 @@ _outConst(StringInfo str, const Const *node)
WRITE_BOOL_FIELD(constisnull);
WRITE_LOCATION_FIELD(location);
appendStringInfo(str, " :constvalue ");
appendStringInfoString(str, " :constvalue ");
if (node->constisnull)
appendStringInfo(str, "<>");
appendStringInfoString(str, "<>");
else
_outDatum(str, node->constvalue, node->constlen, node->constbyval);
}
@ -1104,7 +1104,7 @@ _outBoolExpr(StringInfo str, const BoolExpr *node)
opstr = "not";
break;
}
appendStringInfo(str, " :boolop ");
appendStringInfoString(str, " :boolop ");
_outToken(str, opstr);
WRITE_NODE_FIELD(args);
@ -1477,9 +1477,9 @@ static void
_outPathInfo(StringInfo str, const Path *node)
{
WRITE_ENUM_FIELD(pathtype, NodeTag);
appendStringInfo(str, " :parent_relids ");
appendStringInfoString(str, " :parent_relids ");
_outBitmapset(str, node->parent->relids);
appendStringInfo(str, " :required_outer ");
appendStringInfoString(str, " :required_outer ");
if (node->param_info)
_outBitmapset(str, node->param_info->ppi_req_outer);
else
@ -2232,12 +2232,12 @@ _outQuery(StringInfo str, const Query *node)
WRITE_NODE_FIELD(utilityStmt);
break;
default:
appendStringInfo(str, " :utilityStmt ?");
appendStringInfoString(str, " :utilityStmt ?");
break;
}
}
else
appendStringInfo(str, " :utilityStmt <>");
appendStringInfoString(str, " :utilityStmt <>");
WRITE_INT_FIELD(resultRelation);
WRITE_BOOL_FIELD(hasAggs);
@ -2421,46 +2421,46 @@ _outAExpr(StringInfo str, const A_Expr *node)
switch (node->kind)
{
case AEXPR_OP:
appendStringInfo(str, " ");
appendStringInfoChar(str, ' ');
WRITE_NODE_FIELD(name);
break;
case AEXPR_AND:
appendStringInfo(str, " AND");
appendStringInfoString(str, " AND");
break;
case AEXPR_OR:
appendStringInfo(str, " OR");
appendStringInfoString(str, " OR");
break;
case AEXPR_NOT:
appendStringInfo(str, " NOT");
appendStringInfoString(str, " NOT");
break;
case AEXPR_OP_ANY:
appendStringInfo(str, " ");
appendStringInfoChar(str, ' ');
WRITE_NODE_FIELD(name);
appendStringInfo(str, " ANY ");
appendStringInfoString(str, " ANY ");
break;
case AEXPR_OP_ALL:
appendStringInfo(str, " ");
appendStringInfoChar(str, ' ');
WRITE_NODE_FIELD(name);
appendStringInfo(str, " ALL ");
appendStringInfoString(str, " ALL ");
break;
case AEXPR_DISTINCT:
appendStringInfo(str, " DISTINCT ");
appendStringInfoString(str, " DISTINCT ");
WRITE_NODE_FIELD(name);
break;
case AEXPR_NULLIF:
appendStringInfo(str, " NULLIF ");
appendStringInfoString(str, " NULLIF ");
WRITE_NODE_FIELD(name);
break;
case AEXPR_OF:
appendStringInfo(str, " OF ");
appendStringInfoString(str, " OF ");
WRITE_NODE_FIELD(name);
break;
case AEXPR_IN:
appendStringInfo(str, " IN ");
appendStringInfoString(str, " IN ");
WRITE_NODE_FIELD(name);
break;
default:
appendStringInfo(str, " ??");
appendStringInfoString(str, " ??");
break;
}
@ -2527,7 +2527,7 @@ _outAConst(StringInfo str, const A_Const *node)
{
WRITE_NODE_TYPE("A_CONST");
appendStringInfo(str, " :val ");
appendStringInfoString(str, " :val ");
_outValue(str, &(node->val));
WRITE_LOCATION_FIELD(location);
}
@ -2635,32 +2635,32 @@ _outConstraint(StringInfo str, const Constraint *node)
WRITE_BOOL_FIELD(initdeferred);
WRITE_LOCATION_FIELD(location);
appendStringInfo(str, " :contype ");
appendStringInfoString(str, " :contype ");
switch (node->contype)
{
case CONSTR_NULL:
appendStringInfo(str, "NULL");
appendStringInfoString(str, "NULL");
break;
case CONSTR_NOTNULL:
appendStringInfo(str, "NOT_NULL");
appendStringInfoString(str, "NOT_NULL");
break;
case CONSTR_DEFAULT:
appendStringInfo(str, "DEFAULT");
appendStringInfoString(str, "DEFAULT");
WRITE_NODE_FIELD(raw_expr);
WRITE_STRING_FIELD(cooked_expr);
break;
case CONSTR_CHECK:
appendStringInfo(str, "CHECK");
appendStringInfoString(str, "CHECK");
WRITE_BOOL_FIELD(is_no_inherit);
WRITE_NODE_FIELD(raw_expr);
WRITE_STRING_FIELD(cooked_expr);
break;
case CONSTR_PRIMARY:
appendStringInfo(str, "PRIMARY_KEY");
appendStringInfoString(str, "PRIMARY_KEY");
WRITE_NODE_FIELD(keys);
WRITE_NODE_FIELD(options);
WRITE_STRING_FIELD(indexname);
@ -2669,7 +2669,7 @@ _outConstraint(StringInfo str, const Constraint *node)
break;
case CONSTR_UNIQUE:
appendStringInfo(str, "UNIQUE");
appendStringInfoString(str, "UNIQUE");
WRITE_NODE_FIELD(keys);
WRITE_NODE_FIELD(options);
WRITE_STRING_FIELD(indexname);
@ -2678,7 +2678,7 @@ _outConstraint(StringInfo str, const Constraint *node)
break;
case CONSTR_EXCLUSION:
appendStringInfo(str, "EXCLUSION");
appendStringInfoString(str, "EXCLUSION");
WRITE_NODE_FIELD(exclusions);
WRITE_NODE_FIELD(options);
WRITE_STRING_FIELD(indexname);
@ -2688,7 +2688,7 @@ _outConstraint(StringInfo str, const Constraint *node)
break;
case CONSTR_FOREIGN:
appendStringInfo(str, "FOREIGN_KEY");
appendStringInfoString(str, "FOREIGN_KEY");
WRITE_NODE_FIELD(pktable);
WRITE_NODE_FIELD(fk_attrs);
WRITE_NODE_FIELD(pk_attrs);
@ -2701,19 +2701,19 @@ _outConstraint(StringInfo str, const Constraint *node)
break;
case CONSTR_ATTR_DEFERRABLE:
appendStringInfo(str, "ATTR_DEFERRABLE");
appendStringInfoString(str, "ATTR_DEFERRABLE");
break;
case CONSTR_ATTR_NOT_DEFERRABLE:
appendStringInfo(str, "ATTR_NOT_DEFERRABLE");
appendStringInfoString(str, "ATTR_NOT_DEFERRABLE");
break;
case CONSTR_ATTR_DEFERRED:
appendStringInfo(str, "ATTR_DEFERRED");
appendStringInfoString(str, "ATTR_DEFERRED");
break;
case CONSTR_ATTR_IMMEDIATE:
appendStringInfo(str, "ATTR_IMMEDIATE");
appendStringInfoString(str, "ATTR_IMMEDIATE");
break;
default:
@ -2732,7 +2732,7 @@ static void
_outNode(StringInfo str, const void *obj)
{
if (obj == NULL)
appendStringInfo(str, "<>");
appendStringInfoString(str, "<>");
else if (IsA(obj, List) ||IsA(obj, IntList) || IsA(obj, OidList))
_outList(str, obj);
else if (IsA(obj, Integer) ||

View File

@ -4343,7 +4343,7 @@ ShowUsage(const char *title)
*/
initStringInfo(&str);
appendStringInfo(&str, "! system usage stats:\n");
appendStringInfoString(&str, "! system usage stats:\n");
appendStringInfo(&str,
"!\t%ld.%06ld elapsed %ld.%06ld user %ld.%06ld system sec\n",
(long) (elapse_t.tv_sec - Save_t.tv_sec),

View File

@ -716,7 +716,7 @@ format_operator_internal(Oid operator_oid, bool force_qualify)
format_type_be_qualified(operform->oprleft) :
format_type_be(operform->oprleft));
else
appendStringInfo(&buf, "NONE,");
appendStringInfoString(&buf, "NONE,");
if (operform->oprright)
appendStringInfo(&buf, "%s)",
@ -724,7 +724,7 @@ format_operator_internal(Oid operator_oid, bool force_qualify)
format_type_be_qualified(operform->oprright) :
format_type_be(operform->oprright));
else
appendStringInfo(&buf, "NONE)");
appendStringInfoString(&buf, "NONE)");
result = buf.data;

View File

@ -427,7 +427,7 @@ RI_FKey_check(TriggerData *trigdata)
querysep = "AND";
queryoids[i] = fk_type;
}
appendStringInfo(&querybuf, " FOR KEY SHARE OF x");
appendStringInfoString(&querybuf, " FOR KEY SHARE OF x");
/* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
@ -562,7 +562,7 @@ ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel,
querysep = "AND";
queryoids[i] = pk_type;
}
appendStringInfo(&querybuf, " FOR KEY SHARE OF x");
appendStringInfoString(&querybuf, " FOR KEY SHARE OF x");
/* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
@ -754,7 +754,7 @@ ri_restrict_del(TriggerData *trigdata, bool is_no_action)
querysep = "AND";
queryoids[i] = pk_type;
}
appendStringInfo(&querybuf, " FOR KEY SHARE OF x");
appendStringInfoString(&querybuf, " FOR KEY SHARE OF x");
/* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
@ -977,7 +977,7 @@ ri_restrict_upd(TriggerData *trigdata, bool is_no_action)
querysep = "AND";
queryoids[i] = pk_type;
}
appendStringInfo(&querybuf, " FOR KEY SHARE OF x");
appendStringInfoString(&querybuf, " FOR KEY SHARE OF x");
/* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
@ -2319,7 +2319,7 @@ RI_Initial_Check(Trigger *trigger, Relation fk_rel, Relation pk_rel)
*----------
*/
initStringInfo(&querybuf);
appendStringInfo(&querybuf, "SELECT ");
appendStringInfoString(&querybuf, "SELECT ");
sep = "";
for (i = 0; i < riinfo->nkeys; i++)
{
@ -2391,7 +2391,7 @@ RI_Initial_Check(Trigger *trigger, Relation fk_rel, Relation pk_rel)
break;
}
}
appendStringInfo(&querybuf, ")");
appendStringInfoChar(&querybuf, ')');
/*
* Temporarily increase work_mem so that the check query can be executed

View File

@ -483,7 +483,7 @@ pg_get_ruledef_worker(Oid ruleoid, int prettyFlags)
if (spirc != SPI_OK_SELECT)
elog(ERROR, "failed to get pg_rewrite tuple for rule %u", ruleoid);
if (SPI_processed != 1)
appendStringInfo(&buf, "-");
appendStringInfoChar(&buf, '-');
else
{
/*
@ -638,7 +638,7 @@ pg_get_viewdef_worker(Oid viewoid, int prettyFlags, int wrapColumn)
if (spirc != SPI_OK_SELECT)
elog(ERROR, "failed to get pg_rewrite tuple for view %u", viewoid);
if (SPI_processed != 1)
appendStringInfo(&buf, "Not a view");
appendStringInfoString(&buf, "Not a view");
else
{
/*
@ -725,33 +725,33 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
quote_identifier(tgname));
if (TRIGGER_FOR_BEFORE(trigrec->tgtype))
appendStringInfo(&buf, "BEFORE");
appendStringInfoString(&buf, "BEFORE");
else if (TRIGGER_FOR_AFTER(trigrec->tgtype))
appendStringInfo(&buf, "AFTER");
appendStringInfoString(&buf, "AFTER");
else if (TRIGGER_FOR_INSTEAD(trigrec->tgtype))
appendStringInfo(&buf, "INSTEAD OF");
appendStringInfoString(&buf, "INSTEAD OF");
else
elog(ERROR, "unexpected tgtype value: %d", trigrec->tgtype);
if (TRIGGER_FOR_INSERT(trigrec->tgtype))
{
appendStringInfo(&buf, " INSERT");
appendStringInfoString(&buf, " INSERT");
findx++;
}
if (TRIGGER_FOR_DELETE(trigrec->tgtype))
{
if (findx > 0)
appendStringInfo(&buf, " OR DELETE");
appendStringInfoString(&buf, " OR DELETE");
else
appendStringInfo(&buf, " DELETE");
appendStringInfoString(&buf, " DELETE");
findx++;
}
if (TRIGGER_FOR_UPDATE(trigrec->tgtype))
{
if (findx > 0)
appendStringInfo(&buf, " OR UPDATE");
appendStringInfoString(&buf, " OR UPDATE");
else
appendStringInfo(&buf, " UPDATE");
appendStringInfoString(&buf, " UPDATE");
findx++;
/* tgattr is first var-width field, so OK to access directly */
if (trigrec->tgattr.dim1 > 0)
@ -774,9 +774,9 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
if (TRIGGER_FOR_TRUNCATE(trigrec->tgtype))
{
if (findx > 0)
appendStringInfo(&buf, " OR TRUNCATE");
appendStringInfoString(&buf, " OR TRUNCATE");
else
appendStringInfo(&buf, " TRUNCATE");
appendStringInfoString(&buf, " TRUNCATE");
findx++;
}
appendStringInfo(&buf, " ON %s ",
@ -788,18 +788,18 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
appendStringInfo(&buf, "FROM %s ",
generate_relation_name(trigrec->tgconstrrelid, NIL));
if (!trigrec->tgdeferrable)
appendStringInfo(&buf, "NOT ");
appendStringInfo(&buf, "DEFERRABLE INITIALLY ");
appendStringInfoString(&buf, "NOT ");
appendStringInfoString(&buf, "DEFERRABLE INITIALLY ");
if (trigrec->tginitdeferred)
appendStringInfo(&buf, "DEFERRED ");
appendStringInfoString(&buf, "DEFERRED ");
else
appendStringInfo(&buf, "IMMEDIATE ");
appendStringInfoString(&buf, "IMMEDIATE ");
}
if (TRIGGER_FOR_ROW(trigrec->tgtype))
appendStringInfo(&buf, "FOR EACH ROW ");
appendStringInfoString(&buf, "FOR EACH ROW ");
else
appendStringInfo(&buf, "FOR EACH STATEMENT ");
appendStringInfoString(&buf, "FOR EACH STATEMENT ");
/* If the trigger has a WHEN qualification, add that */
value = fastgetattr(ht_trig, Anum_pg_trigger_tgqual,
@ -859,7 +859,7 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
get_rule_expr(qual, &context, false);
appendStringInfo(&buf, ") ");
appendStringInfoString(&buf, ") ");
}
appendStringInfo(&buf, "EXECUTE PROCEDURE %s(",
@ -880,7 +880,7 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
for (i = 0; i < trigrec->tgnargs; i++)
{
if (i > 0)
appendStringInfo(&buf, ", ");
appendStringInfoString(&buf, ", ");
simple_quote_literal(&buf, p);
/* advance p to next string embedded in tgargs */
while (*p)
@ -890,7 +890,7 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
}
/* We deliberately do not put semi-colon at end */
appendStringInfo(&buf, ")");
appendStringInfoChar(&buf, ')');
/* Clean up */
systable_endscan(tgscan);
@ -1154,15 +1154,15 @@ pg_get_indexdef_worker(Oid indexrelid, int colno,
/* if it supports sort ordering, report DESC and NULLS opts */
if (opt & INDOPTION_DESC)
{
appendStringInfo(&buf, " DESC");
appendStringInfoString(&buf, " DESC");
/* NULLS FIRST is the default in this case */
if (!(opt & INDOPTION_NULLS_FIRST))
appendStringInfo(&buf, " NULLS LAST");
appendStringInfoString(&buf, " NULLS LAST");
}
else
{
if (opt & INDOPTION_NULLS_FIRST)
appendStringInfo(&buf, " NULLS FIRST");
appendStringInfoString(&buf, " NULLS FIRST");
}
}
@ -1312,7 +1312,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
const char *string;
/* Start off the constraint definition */
appendStringInfo(&buf, "FOREIGN KEY (");
appendStringInfoString(&buf, "FOREIGN KEY (");
/* Fetch and build referencing-column list */
val = SysCacheGetAttr(CONSTROID, tup,
@ -1337,7 +1337,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
decompile_column_index_array(val, conForm->confrelid, &buf);
appendStringInfo(&buf, ")");
appendStringInfoChar(&buf, ')');
/* Add match type */
switch (conForm->confmatchtype)
@ -1423,9 +1423,9 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
/* Start off the constraint definition */
if (conForm->contype == CONSTRAINT_PRIMARY)
appendStringInfo(&buf, "PRIMARY KEY (");
appendStringInfoString(&buf, "PRIMARY KEY (");
else
appendStringInfo(&buf, "UNIQUE (");
appendStringInfoString(&buf, "UNIQUE (");
/* Fetch and build target column list */
val = SysCacheGetAttr(CONSTROID, tup,
@ -1436,7 +1436,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
decompile_column_index_array(val, conForm->conrelid, &buf);
appendStringInfo(&buf, ")");
appendStringInfoChar(&buf, ')');
indexId = get_constraint_index(constraintId);
@ -1520,7 +1520,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
* throw an error; if we throw error then this function couldn't
* safely be applied to all rows of pg_constraint.
*/
appendStringInfo(&buf, "TRIGGER");
appendStringInfoString(&buf, "TRIGGER");
break;
case CONSTRAINT_EXCLUSION:
{
@ -1565,9 +1565,9 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
}
if (conForm->condeferrable)
appendStringInfo(&buf, " DEFERRABLE");
appendStringInfoString(&buf, " DEFERRABLE");
if (conForm->condeferred)
appendStringInfo(&buf, " INITIALLY DEFERRED");
appendStringInfoString(&buf, " INITIALLY DEFERRED");
if (!conForm->convalidated)
appendStringInfoString(&buf, " NOT VALID");
@ -2029,7 +2029,7 @@ pg_get_functiondef(PG_FUNCTION_ARGS)
appendStringInfoString(&buf, prosrc);
appendStringInfoString(&buf, dq.data);
appendStringInfoString(&buf, "\n");
appendStringInfoChar(&buf, '\n');
ReleaseSysCache(langtup);
ReleaseSysCache(proctup);
@ -3789,19 +3789,19 @@ make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
switch (ev_type)
{
case '1':
appendStringInfo(buf, "SELECT");
appendStringInfoString(buf, "SELECT");
break;
case '2':
appendStringInfo(buf, "UPDATE");
appendStringInfoString(buf, "UPDATE");
break;
case '3':
appendStringInfo(buf, "INSERT");
appendStringInfoString(buf, "INSERT");
break;
case '4':
appendStringInfo(buf, "DELETE");
appendStringInfoString(buf, "DELETE");
break;
default:
@ -3827,7 +3827,7 @@ make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
if (prettyFlags & PRETTYFLAG_INDENT)
appendStringInfoString(buf, "\n ");
appendStringInfo(buf, " WHERE ");
appendStringInfoString(buf, " WHERE ");
qual = stringToNode(ev_qual);
@ -3862,11 +3862,11 @@ make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
get_rule_expr(qual, &context, false);
}
appendStringInfo(buf, " DO ");
appendStringInfoString(buf, " DO ");
/* The INSTEAD keyword (if so) */
if (is_instead)
appendStringInfo(buf, "INSTEAD ");
appendStringInfoString(buf, "INSTEAD ");
/* Finally the rules actions */
if (list_length(actions) > 1)
@ -3874,22 +3874,22 @@ make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
ListCell *action;
Query *query;
appendStringInfo(buf, "(");
appendStringInfoChar(buf, '(');
foreach(action, actions)
{
query = (Query *) lfirst(action);
get_query_def(query, buf, NIL, NULL,
prettyFlags, WRAP_COLUMN_DEFAULT, 0);
if (prettyFlags)
appendStringInfo(buf, ";\n");
appendStringInfoString(buf, ";\n");
else
appendStringInfo(buf, "; ");
appendStringInfoString(buf, "; ");
}
appendStringInfo(buf, ");");
appendStringInfoString(buf, ");");
}
else if (list_length(actions) == 0)
{
appendStringInfo(buf, "NOTHING;");
appendStringInfoString(buf, "NOTHING;");
}
else
{
@ -3898,7 +3898,7 @@ make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
query = (Query *) linitial(actions);
get_query_def(query, buf, NIL, NULL,
prettyFlags, WRAP_COLUMN_DEFAULT, 0);
appendStringInfo(buf, ";");
appendStringInfoChar(buf, ';');
}
}
@ -3945,7 +3945,7 @@ make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
if (list_length(actions) != 1)
{
appendStringInfo(buf, "Not a view");
appendStringInfoString(buf, "Not a view");
return;
}
@ -3954,7 +3954,7 @@ make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
if (ev_type != '1' || !is_instead ||
strcmp(ev_qual, "<>") != 0 || query->commandType != CMD_SELECT)
{
appendStringInfo(buf, "Not a view");
appendStringInfoString(buf, "Not a view");
return;
}
@ -3962,7 +3962,7 @@ make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
get_query_def(query, buf, NIL, RelationGetDescr(ev_relation),
prettyFlags, wrapColumn, 0);
appendStringInfo(buf, ";");
appendStringInfoChar(buf, ';');
heap_close(ev_relation, AccessShareLock);
}
@ -4022,7 +4022,7 @@ get_query_def(Query *query, StringInfo buf, List *parentnamespace,
break;
case CMD_NOTHING:
appendStringInfo(buf, "NOTHING");
appendStringInfoString(buf, "NOTHING");
break;
case CMD_UTILITY:
@ -4211,7 +4211,7 @@ get_select_query_def(Query *query, deparse_context *context,
-PRETTYINDENT_STD, PRETTYINDENT_STD, 0);
if (IsA(query->limitCount, Const) &&
((Const *) query->limitCount)->constisnull)
appendStringInfo(buf, "ALL");
appendStringInfoString(buf, "ALL");
else
get_rule_expr(query->limitCount, context, false);
}
@ -4251,7 +4251,7 @@ get_select_query_def(Query *query, deparse_context *context,
quote_identifier(get_rtable_name(rc->rti,
context)));
if (rc->noWait)
appendStringInfo(buf, " NOWAIT");
appendStringInfoString(buf, " NOWAIT");
}
}
@ -4325,14 +4325,14 @@ get_basic_select_query(Query *query, deparse_context *context,
/*
* Build up the query string - first we say SELECT
*/
appendStringInfo(buf, "SELECT");
appendStringInfoString(buf, "SELECT");
/* Add the DISTINCT clause if given */
if (query->distinctClause != NIL)
{
if (query->hasDistinctOn)
{
appendStringInfo(buf, " DISTINCT ON (");
appendStringInfoString(buf, " DISTINCT ON (");
sep = "";
foreach(l, query->distinctClause)
{
@ -4343,10 +4343,10 @@ get_basic_select_query(Query *query, deparse_context *context,
false, context);
sep = ", ";
}
appendStringInfo(buf, ")");
appendStringInfoChar(buf, ')');
}
else
appendStringInfo(buf, " DISTINCT");
appendStringInfoString(buf, " DISTINCT");
}
/* Then we tell what to select (the targetlist) */
@ -4603,7 +4603,7 @@ get_setop_query(Node *setOp, Query *query, deparse_context *context,
(int) op->op);
}
if (op->all)
appendStringInfo(buf, "ALL ");
appendStringInfoString(buf, "ALL ");
if (PRETTY_INDENT(context))
appendContextKeyword(context, "", 0, 0, 0);
@ -4693,14 +4693,14 @@ get_rule_orderby(List *orderList, List *targetList,
{
/* ASC is default, so emit nothing for it */
if (srt->nulls_first)
appendStringInfo(buf, " NULLS FIRST");
appendStringInfoString(buf, " NULLS FIRST");
}
else if (srt->sortop == typentry->gt_opr)
{
appendStringInfo(buf, " DESC");
appendStringInfoString(buf, " DESC");
/* DESC defaults to NULLS FIRST */
if (!srt->nulls_first)
appendStringInfo(buf, " NULLS LAST");
appendStringInfoString(buf, " NULLS LAST");
}
else
{
@ -4710,9 +4710,9 @@ get_rule_orderby(List *orderList, List *targetList,
sortcoltype));
/* be specific to eliminate ambiguity */
if (srt->nulls_first)
appendStringInfo(buf, " NULLS FIRST");
appendStringInfoString(buf, " NULLS FIRST");
else
appendStringInfo(buf, " NULLS LAST");
appendStringInfoString(buf, " NULLS LAST");
}
sep = ", ";
}
@ -4964,7 +4964,7 @@ get_insert_query_def(Query *query, deparse_context *context)
}
}
if (query->targetList)
appendStringInfo(buf, ") ");
appendStringInfoString(buf, ") ");
if (select_rte)
{
@ -4989,7 +4989,7 @@ get_insert_query_def(Query *query, deparse_context *context)
else
{
/* No expressions, so it must be DEFAULT VALUES */
appendStringInfo(buf, "DEFAULT VALUES");
appendStringInfoString(buf, "DEFAULT VALUES");
}
/* Add RETURNING if present */
@ -5062,7 +5062,7 @@ get_update_query_def(Query *query, deparse_context *context)
*/
expr = processIndirection((Node *) tle->expr, context, true);
appendStringInfo(buf, " = ");
appendStringInfoString(buf, " = ");
get_rule_expr(expr, context, false);
}
@ -6426,7 +6426,7 @@ get_rule_expr(Node *node, deparse_context *context,
if (!PRETTY_PAREN(context))
appendStringInfoChar(buf, '(');
get_rule_expr_paren(arg1, context, true, node);
appendStringInfo(buf, " IS DISTINCT FROM ");
appendStringInfoString(buf, " IS DISTINCT FROM ");
get_rule_expr_paren(arg2, context, true, node);
if (!PRETTY_PAREN(context))
appendStringInfoChar(buf, ')');
@ -6437,7 +6437,7 @@ get_rule_expr(Node *node, deparse_context *context,
{
NullIfExpr *nullifexpr = (NullIfExpr *) node;
appendStringInfo(buf, "NULLIF(");
appendStringInfoString(buf, "NULLIF(");
get_rule_expr((Node *) nullifexpr->args, context, true);
appendStringInfoChar(buf, ')');
}
@ -6480,7 +6480,7 @@ get_rule_expr(Node *node, deparse_context *context,
false, node);
while (arg)
{
appendStringInfo(buf, " AND ");
appendStringInfoString(buf, " AND ");
get_rule_expr_paren((Node *) lfirst(arg), context,
false, node);
arg = lnext(arg);
@ -6496,7 +6496,7 @@ get_rule_expr(Node *node, deparse_context *context,
false, node);
while (arg)
{
appendStringInfo(buf, " OR ");
appendStringInfoString(buf, " OR ");
get_rule_expr_paren((Node *) lfirst(arg), context,
false, node);
arg = lnext(arg);
@ -6508,7 +6508,7 @@ get_rule_expr(Node *node, deparse_context *context,
case NOT_EXPR:
if (!PRETTY_PAREN(context))
appendStringInfoChar(buf, '(');
appendStringInfo(buf, "NOT ");
appendStringInfoString(buf, "NOT ");
get_rule_expr_paren(first_arg, context,
false, node);
if (!PRETTY_PAREN(context))
@ -6549,7 +6549,7 @@ get_rule_expr(Node *node, deparse_context *context,
ListCell *lc;
/* As above, this can only happen during EXPLAIN */
appendStringInfo(buf, "(alternatives: ");
appendStringInfoString(buf, "(alternatives: ");
foreach(lc, asplan->subplans)
{
SubPlan *splan = (SubPlan *) lfirst(lc);
@ -6558,11 +6558,11 @@ get_rule_expr(Node *node, deparse_context *context,
if (splan->useHashTable)
appendStringInfo(buf, "hashed %s", splan->plan_name);
else
appendStringInfo(buf, "%s", splan->plan_name);
appendStringInfoString(buf, splan->plan_name);
if (lnext(lc))
appendStringInfo(buf, " or ");
appendStringInfoString(buf, " or ");
}
appendStringInfo(buf, ")");
appendStringInfoChar(buf, ')');
}
break;
@ -6774,7 +6774,7 @@ get_rule_expr(Node *node, deparse_context *context,
appendContextKeyword(context, "WHEN ",
0, 0, 0);
get_rule_expr(w, context, false);
appendStringInfo(buf, " THEN ");
appendStringInfoString(buf, " THEN ");
get_rule_expr((Node *) when->result, context, true);
}
if (!PRETTY_INDENT(context))
@ -6798,7 +6798,7 @@ get_rule_expr(Node *node, deparse_context *context,
* be unable to avoid that (see comments for CaseExpr). If we
* do see one, print it as CASE_TEST_EXPR.
*/
appendStringInfo(buf, "CASE_TEST_EXPR");
appendStringInfoString(buf, "CASE_TEST_EXPR");
}
break;
@ -6806,7 +6806,7 @@ get_rule_expr(Node *node, deparse_context *context,
{
ArrayExpr *arrayexpr = (ArrayExpr *) node;
appendStringInfo(buf, "ARRAY[");
appendStringInfoString(buf, "ARRAY[");
get_rule_expr((Node *) arrayexpr->elements, context, true);
appendStringInfoChar(buf, ']');
@ -6844,7 +6844,7 @@ get_rule_expr(Node *node, deparse_context *context,
* SQL99 allows "ROW" to be omitted when there is more than
* one column, but for simplicity we always print it.
*/
appendStringInfo(buf, "ROW(");
appendStringInfoString(buf, "ROW(");
sep = "";
i = 0;
foreach(arg, rowexpr->args)
@ -6867,7 +6867,7 @@ get_rule_expr(Node *node, deparse_context *context,
if (!tupdesc->attrs[i]->attisdropped)
{
appendStringInfoString(buf, sep);
appendStringInfo(buf, "NULL");
appendStringInfoString(buf, "NULL");
sep = ", ";
}
i++;
@ -6875,7 +6875,7 @@ get_rule_expr(Node *node, deparse_context *context,
ReleaseTupleDesc(tupdesc);
}
appendStringInfo(buf, ")");
appendStringInfoChar(buf, ')');
if (rowexpr->row_format == COERCE_EXPLICIT_CAST)
appendStringInfo(buf, "::%s",
format_type_with_typemod(rowexpr->row_typeid, -1));
@ -6892,7 +6892,7 @@ get_rule_expr(Node *node, deparse_context *context,
* SQL99 allows "ROW" to be omitted when there is more than
* one column, but for simplicity we always print it.
*/
appendStringInfo(buf, "(ROW(");
appendStringInfoString(buf, "(ROW(");
sep = "";
foreach(arg, rcexpr->largs)
{
@ -6923,7 +6923,7 @@ get_rule_expr(Node *node, deparse_context *context,
get_rule_expr(e, context, true);
sep = ", ";
}
appendStringInfo(buf, "))");
appendStringInfoString(buf, "))");
}
break;
@ -6931,7 +6931,7 @@ get_rule_expr(Node *node, deparse_context *context,
{
CoalesceExpr *coalesceexpr = (CoalesceExpr *) node;
appendStringInfo(buf, "COALESCE(");
appendStringInfoString(buf, "COALESCE(");
get_rule_expr((Node *) coalesceexpr->args, context, true);
appendStringInfoChar(buf, ')');
}
@ -6944,10 +6944,10 @@ get_rule_expr(Node *node, deparse_context *context,
switch (minmaxexpr->op)
{
case IS_GREATEST:
appendStringInfo(buf, "GREATEST(");
appendStringInfoString(buf, "GREATEST(");
break;
case IS_LEAST:
appendStringInfo(buf, "LEAST(");
appendStringInfoString(buf, "LEAST(");
break;
}
get_rule_expr((Node *) minmaxexpr->args, context, true);
@ -7122,10 +7122,10 @@ get_rule_expr(Node *node, deparse_context *context,
switch (ntest->nulltesttype)
{
case IS_NULL:
appendStringInfo(buf, " IS NULL");
appendStringInfoString(buf, " IS NULL");
break;
case IS_NOT_NULL:
appendStringInfo(buf, " IS NOT NULL");
appendStringInfoString(buf, " IS NOT NULL");
break;
default:
elog(ERROR, "unrecognized nulltesttype: %d",
@ -7146,22 +7146,22 @@ get_rule_expr(Node *node, deparse_context *context,
switch (btest->booltesttype)
{
case IS_TRUE:
appendStringInfo(buf, " IS TRUE");
appendStringInfoString(buf, " IS TRUE");
break;
case IS_NOT_TRUE:
appendStringInfo(buf, " IS NOT TRUE");
appendStringInfoString(buf, " IS NOT TRUE");
break;
case IS_FALSE:
appendStringInfo(buf, " IS FALSE");
appendStringInfoString(buf, " IS FALSE");
break;
case IS_NOT_FALSE:
appendStringInfo(buf, " IS NOT FALSE");
appendStringInfoString(buf, " IS NOT FALSE");
break;
case IS_UNKNOWN:
appendStringInfo(buf, " IS UNKNOWN");
appendStringInfoString(buf, " IS UNKNOWN");
break;
case IS_NOT_UNKNOWN:
appendStringInfo(buf, " IS NOT UNKNOWN");
appendStringInfoString(buf, " IS NOT UNKNOWN");
break;
default:
elog(ERROR, "unrecognized booltesttype: %d",
@ -7194,11 +7194,11 @@ get_rule_expr(Node *node, deparse_context *context,
break;
case T_CoerceToDomainValue:
appendStringInfo(buf, "VALUE");
appendStringInfoString(buf, "VALUE");
break;
case T_SetToDefault:
appendStringInfo(buf, "DEFAULT");
appendStringInfoString(buf, "DEFAULT");
break;
case T_CurrentOfExpr:
@ -7592,7 +7592,7 @@ get_const_expr(Const *constval, deparse_context *context, int showtype)
* Always label the type of a NULL constant to prevent misdecisions
* about type when reparsing.
*/
appendStringInfo(buf, "NULL");
appendStringInfoString(buf, "NULL");
if (showtype >= 0)
{
appendStringInfo(buf, "::%s",
@ -7654,9 +7654,9 @@ get_const_expr(Const *constval, deparse_context *context, int showtype)
case BOOLOID:
if (strcmp(extval, "t") == 0)
appendStringInfo(buf, "true");
appendStringInfoString(buf, "true");
else
appendStringInfo(buf, "false");
appendStringInfoString(buf, "false");
break;
default:
@ -7763,7 +7763,7 @@ get_sublink_expr(SubLink *sublink, deparse_context *context)
bool need_paren;
if (sublink->subLinkType == ARRAY_SUBLINK)
appendStringInfo(buf, "ARRAY(");
appendStringInfoString(buf, "ARRAY(");
else
appendStringInfoChar(buf, '(');
@ -7831,12 +7831,12 @@ get_sublink_expr(SubLink *sublink, deparse_context *context)
switch (sublink->subLinkType)
{
case EXISTS_SUBLINK:
appendStringInfo(buf, "EXISTS ");
appendStringInfoString(buf, "EXISTS ");
break;
case ANY_SUBLINK:
if (strcmp(opname, "=") == 0) /* Represent = ANY as IN */
appendStringInfo(buf, " IN ");
appendStringInfoString(buf, " IN ");
else
appendStringInfo(buf, " %s ANY ", opname);
break;
@ -7869,7 +7869,7 @@ get_sublink_expr(SubLink *sublink, deparse_context *context)
context->indentLevel);
if (need_paren)
appendStringInfo(buf, "))");
appendStringInfoString(buf, "))");
else
appendStringInfoChar(buf, ')');
}
@ -8140,7 +8140,7 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context)
ListCell *lc;
bool first = true;
appendStringInfo(buf, " USING (");
appendStringInfoString(buf, " USING (");
/* Use the assigned names, not what's in usingClause */
foreach(lc, colinfo->usingNames)
{
@ -8149,14 +8149,14 @@ get_from_clause_item(Node *jtnode, Query *query, deparse_context *context)
if (first)
first = false;
else
appendStringInfo(buf, ", ");
appendStringInfoString(buf, ", ");
appendStringInfoString(buf, quote_identifier(colname));
}
appendStringInfoChar(buf, ')');
}
else if (j->quals)
{
appendStringInfo(buf, " ON ");
appendStringInfoString(buf, " ON ");
if (!PRETTY_PAREN(context))
appendStringInfoChar(buf, '(');
get_rule_expr(j->quals, context, false);
@ -8206,7 +8206,7 @@ get_column_alias_list(deparse_columns *colinfo, deparse_context *context)
first = false;
}
else
appendStringInfo(buf, ", ");
appendStringInfoString(buf, ", ");
appendStringInfoString(buf, quote_identifier(colname));
}
if (!first)
@ -8243,7 +8243,7 @@ get_from_clause_coldeflist(deparse_columns *colinfo,
Assert(attname); /* shouldn't be any dropped columns here */
if (i > 0)
appendStringInfo(buf, ", ");
appendStringInfoString(buf, ", ");
appendStringInfo(buf, "%s %s",
quote_identifier(attname),
format_type_with_typemod(atttypid, atttypmod));

View File

@ -442,9 +442,9 @@ xmlcomment(PG_FUNCTION_ARGS)
errmsg("invalid XML comment")));
initStringInfo(&buf);
appendStringInfo(&buf, "<!--");
appendStringInfoString(&buf, "<!--");
appendStringInfoText(&buf, arg);
appendStringInfo(&buf, "-->");
appendStringInfoString(&buf, "-->");
PG_RETURN_XML_P(stringinfo_to_xmltype(&buf));
#else
@ -1852,19 +1852,19 @@ map_sql_identifier_to_xml_name(char *ident, bool fully_escaped,
for (p = ident; *p; p += pg_mblen(p))
{
if (*p == ':' && (p == ident || fully_escaped))
appendStringInfo(&buf, "_x003A_");
appendStringInfoString(&buf, "_x003A_");
else if (*p == '_' && *(p + 1) == 'x')
appendStringInfo(&buf, "_x005F_");
appendStringInfoString(&buf, "_x005F_");
else if (fully_escaped && p == ident &&
pg_strncasecmp(p, "xml", 3) == 0)
{
if (*p == 'x')
appendStringInfo(&buf, "_x0078_");
appendStringInfoString(&buf, "_x0078_");
else
appendStringInfo(&buf, "_x0058_");
appendStringInfoString(&buf, "_x0058_");
}
else if (escape_period && *p == '.')
appendStringInfo(&buf, "_x002E_");
appendStringInfoString(&buf, "_x002E_");
else
{
pg_wchar u = sqlchar_to_unicode(p);
@ -2438,9 +2438,9 @@ xmldata_root_element_start(StringInfo result, const char *eltname,
if (strlen(targetns) > 0)
appendStringInfo(result, " xsi:schemaLocation=\"%s #\"", targetns);
else
appendStringInfo(result, " xsi:noNamespaceSchemaLocation=\"#\"");
appendStringInfoString(result, " xsi:noNamespaceSchemaLocation=\"#\"");
}
appendStringInfo(result, ">\n");
appendStringInfoString(result, ">\n");
}
@ -2945,7 +2945,7 @@ map_multipart_sql_identifier_to_xml_name(char *a, char *b, char *c, char *d)
initStringInfo(&result);
if (a)
appendStringInfo(&result, "%s",
appendStringInfoString(&result,
map_sql_identifier_to_xml_name(a, true, true));
if (b)
appendStringInfo(&result, ".%s",
@ -3212,71 +3212,71 @@ map_sql_type_to_xml_name(Oid typeoid, int typmod)
{
case BPCHAROID:
if (typmod == -1)
appendStringInfo(&result, "CHAR");
appendStringInfoString(&result, "CHAR");
else
appendStringInfo(&result, "CHAR_%d", typmod - VARHDRSZ);
break;
case VARCHAROID:
if (typmod == -1)
appendStringInfo(&result, "VARCHAR");
appendStringInfoString(&result, "VARCHAR");
else
appendStringInfo(&result, "VARCHAR_%d", typmod - VARHDRSZ);
break;
case NUMERICOID:
if (typmod == -1)
appendStringInfo(&result, "NUMERIC");
appendStringInfoString(&result, "NUMERIC");
else
appendStringInfo(&result, "NUMERIC_%d_%d",
((typmod - VARHDRSZ) >> 16) & 0xffff,
(typmod - VARHDRSZ) & 0xffff);
break;
case INT4OID:
appendStringInfo(&result, "INTEGER");
appendStringInfoString(&result, "INTEGER");
break;
case INT2OID:
appendStringInfo(&result, "SMALLINT");
appendStringInfoString(&result, "SMALLINT");
break;
case INT8OID:
appendStringInfo(&result, "BIGINT");
appendStringInfoString(&result, "BIGINT");
break;
case FLOAT4OID:
appendStringInfo(&result, "REAL");
appendStringInfoString(&result, "REAL");
break;
case FLOAT8OID:
appendStringInfo(&result, "DOUBLE");
appendStringInfoString(&result, "DOUBLE");
break;
case BOOLOID:
appendStringInfo(&result, "BOOLEAN");
appendStringInfoString(&result, "BOOLEAN");
break;
case TIMEOID:
if (typmod == -1)
appendStringInfo(&result, "TIME");
appendStringInfoString(&result, "TIME");
else
appendStringInfo(&result, "TIME_%d", typmod);
break;
case TIMETZOID:
if (typmod == -1)
appendStringInfo(&result, "TIME_WTZ");
appendStringInfoString(&result, "TIME_WTZ");
else
appendStringInfo(&result, "TIME_WTZ_%d", typmod);
break;
case TIMESTAMPOID:
if (typmod == -1)
appendStringInfo(&result, "TIMESTAMP");
appendStringInfoString(&result, "TIMESTAMP");
else
appendStringInfo(&result, "TIMESTAMP_%d", typmod);
break;
case TIMESTAMPTZOID:
if (typmod == -1)
appendStringInfo(&result, "TIMESTAMP_WTZ");
appendStringInfoString(&result, "TIMESTAMP_WTZ");
else
appendStringInfo(&result, "TIMESTAMP_WTZ_%d", typmod);
break;
case DATEOID:
appendStringInfo(&result, "DATE");
appendStringInfoString(&result, "DATE");
break;
case XMLOID:
appendStringInfo(&result, "XML");
appendStringInfoString(&result, "XML");
break;
default:
{
@ -3370,7 +3370,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
if (typeoid == XMLOID)
{
appendStringInfo(&result,
appendStringInfoString(&result,
"<xsd:complexType mixed=\"true\">\n"
" <xsd:sequence>\n"
" <xsd:any name=\"element\" minOccurs=\"0\" maxOccurs=\"unbounded\" processContents=\"skip\"/>\n"
@ -3393,8 +3393,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
appendStringInfo(&result,
" <xsd:maxLength value=\"%d\"/>\n",
typmod - VARHDRSZ);
appendStringInfo(&result,
" </xsd:restriction>\n");
appendStringInfoString(&result, " </xsd:restriction>\n");
break;
case BYTEAOID:
@ -3444,17 +3443,17 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
break;
case FLOAT4OID:
appendStringInfo(&result,
appendStringInfoString(&result,
" <xsd:restriction base=\"xsd:float\"></xsd:restriction>\n");
break;
case FLOAT8OID:
appendStringInfo(&result,
appendStringInfoString(&result,
" <xsd:restriction base=\"xsd:double\"></xsd:restriction>\n");
break;
case BOOLOID:
appendStringInfo(&result,
appendStringInfoString(&result,
" <xsd:restriction base=\"xsd:boolean\"></xsd:restriction>\n");
break;
@ -3505,7 +3504,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
}
case DATEOID:
appendStringInfo(&result,
appendStringInfoString(&result,
" <xsd:restriction base=\"xsd:date\">\n"
" <xsd:pattern value=\"\\p{Nd}{4}-\\p{Nd}{2}-\\p{Nd}{2}\"/>\n"
" </xsd:restriction>\n");
@ -3525,8 +3524,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
}
break;
}
appendStringInfo(&result,
"</xsd:simpleType>\n");
appendStringInfoString(&result, "</xsd:simpleType>\n");
}
return result.data;

View File

@ -372,7 +372,7 @@ incompatible_module_error(const char *libname,
}
if (details.len == 0)
appendStringInfo(&details,
appendStringInfoString(&details,
_("Magic block has unexpected length or padding difference."));
ereport(ERROR,

View File

@ -6187,7 +6187,7 @@ flatten_set_variable_args(const char *name, List *args)
A_Const *con;
if (l != list_head(args))
appendStringInfo(&buf, ", ");
appendStringInfoString(&buf, ", ");
if (IsA(arg, TypeCast))
{