Commit cacbdd78 authored by Robert Haas's avatar Robert Haas

Use appendStringInfoString instead of appendStringInfo where possible.

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

David Rowley
parent 343bb134
...@@ -335,18 +335,18 @@ cube_out(PG_FUNCTION_ARGS) ...@@ -335,18 +335,18 @@ cube_out(PG_FUNCTION_ARGS)
for (i = 0; i < dim; i++) for (i = 0; i < dim; i++)
{ {
if (i > 0) if (i > 0)
appendStringInfo(&buf, ", "); appendStringInfoString(&buf, ", ");
appendStringInfo(&buf, "%.*g", ndig, LL_COORD(cube, i)); appendStringInfo(&buf, "%.*g", ndig, LL_COORD(cube, i));
} }
appendStringInfoChar(&buf, ')'); appendStringInfoChar(&buf, ')');
if (!cube_is_point_internal(cube)) if (!cube_is_point_internal(cube))
{ {
appendStringInfo(&buf, ",("); appendStringInfoString(&buf, ",(");
for (i = 0; i < dim; i++) for (i = 0; i < dim; i++)
{ {
if (i > 0) if (i > 0)
appendStringInfo(&buf, ", "); appendStringInfoString(&buf, ", ");
appendStringInfo(&buf, "%.*g", ndig, UR_COORD(cube, i)); appendStringInfo(&buf, "%.*g", ndig, UR_COORD(cube, i));
} }
appendStringInfoChar(&buf, ')'); appendStringInfoChar(&buf, ')');
......
...@@ -2169,14 +2169,14 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals ...@@ -2169,14 +2169,14 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
continue; continue;
if (needComma) if (needComma)
appendStringInfo(&buf, ","); appendStringInfoChar(&buf, ',');
appendStringInfoString(&buf, appendStringInfoString(&buf,
quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname))); quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname)));
needComma = true; needComma = true;
} }
appendStringInfo(&buf, ") VALUES("); appendStringInfoString(&buf, ") VALUES(");
/* /*
* Note: i is physical column number (counting from 0). * 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 ...@@ -2188,7 +2188,7 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
continue; continue;
if (needComma) if (needComma)
appendStringInfo(&buf, ","); appendStringInfoChar(&buf, ',');
key = get_attnum_pk_pos(pkattnums, pknumatts, i); key = get_attnum_pk_pos(pkattnums, pknumatts, i);
...@@ -2203,10 +2203,10 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals ...@@ -2203,10 +2203,10 @@ get_sql_insert(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
pfree(val); pfree(val);
} }
else else
appendStringInfo(&buf, "NULL"); appendStringInfoString(&buf, "NULL");
needComma = true; needComma = true;
} }
appendStringInfo(&buf, ")"); appendStringInfoChar(&buf, ')');
return (buf.data); return (buf.data);
} }
...@@ -2232,7 +2232,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals ...@@ -2232,7 +2232,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals
int pkattnum = pkattnums[i]; int pkattnum = pkattnums[i];
if (i > 0) if (i > 0)
appendStringInfo(&buf, " AND "); appendStringInfoString(&buf, " AND ");
appendStringInfoString(&buf, appendStringInfoString(&buf,
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname))); quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
...@@ -2241,7 +2241,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals ...@@ -2241,7 +2241,7 @@ get_sql_delete(Relation rel, int *pkattnums, int pknumatts, char **tgt_pkattvals
appendStringInfo(&buf, " = %s", appendStringInfo(&buf, " = %s",
quote_literal_cstr(tgt_pkattvals[i])); quote_literal_cstr(tgt_pkattvals[i]));
else else
appendStringInfo(&buf, " IS NULL"); appendStringInfoString(&buf, " IS NULL");
} }
return (buf.data); return (buf.data);
...@@ -2286,7 +2286,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals ...@@ -2286,7 +2286,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
continue; continue;
if (needComma) if (needComma)
appendStringInfo(&buf, ", "); appendStringInfoString(&buf, ", ");
appendStringInfo(&buf, "%s = ", appendStringInfo(&buf, "%s = ",
quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname))); quote_ident_cstr(NameStr(tupdesc->attrs[i]->attname)));
...@@ -2308,16 +2308,16 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals ...@@ -2308,16 +2308,16 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
needComma = true; needComma = true;
} }
appendStringInfo(&buf, " WHERE "); appendStringInfoString(&buf, " WHERE ");
for (i = 0; i < pknumatts; i++) for (i = 0; i < pknumatts; i++)
{ {
int pkattnum = pkattnums[i]; int pkattnum = pkattnums[i];
if (i > 0) if (i > 0)
appendStringInfo(&buf, " AND "); appendStringInfoString(&buf, " AND ");
appendStringInfo(&buf, "%s", appendStringInfoString(&buf,
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname))); quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname)));
val = tgt_pkattvals[i]; val = tgt_pkattvals[i];
...@@ -2325,7 +2325,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals ...@@ -2325,7 +2325,7 @@ get_sql_update(Relation rel, int *pkattnums, int pknumatts, char **src_pkattvals
if (val != NULL) if (val != NULL)
appendStringInfo(&buf, " = %s", quote_literal_cstr(val)); appendStringInfo(&buf, " = %s", quote_literal_cstr(val));
else else
appendStringInfo(&buf, " IS NULL"); appendStringInfoString(&buf, " IS NULL");
} }
return (buf.data); return (buf.data);
...@@ -2419,7 +2419,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk ...@@ -2419,7 +2419,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
int pkattnum = pkattnums[i]; int pkattnum = pkattnums[i];
if (i > 0) if (i > 0)
appendStringInfo(&buf, " AND "); appendStringInfoString(&buf, " AND ");
appendStringInfoString(&buf, appendStringInfoString(&buf,
quote_ident_cstr(NameStr(tupdesc->attrs[pkattnum]->attname))); 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 ...@@ -2428,7 +2428,7 @@ get_tuple_of_interest(Relation rel, int *pkattnums, int pknumatts, char **src_pk
appendStringInfo(&buf, " = %s", appendStringInfo(&buf, " = %s",
quote_literal_cstr(src_pkattvals[i])); quote_literal_cstr(src_pkattvals[i]));
else else
appendStringInfo(&buf, " IS NULL"); appendStringInfoString(&buf, " IS NULL");
} }
/* /*
......
...@@ -1972,7 +1972,7 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors) ...@@ -1972,7 +1972,7 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
initStringInfo(&buf); initStringInfo(&buf);
appendStringInfo(&buf, "\ndigraph sourceNFA {\n"); appendStringInfoString(&buf, "\ndigraph sourceNFA {\n");
for (state = 0; state < nstates; state++) for (state = 0; state < nstates; state++)
{ {
...@@ -1982,8 +1982,8 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors) ...@@ -1982,8 +1982,8 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
appendStringInfo(&buf, "s%d", state); appendStringInfo(&buf, "s%d", state);
if (pg_reg_getfinalstate(regex) == state) if (pg_reg_getfinalstate(regex) == state)
appendStringInfo(&buf, " [shape = doublecircle]"); appendStringInfoString(&buf, " [shape = doublecircle]");
appendStringInfo(&buf, ";\n"); appendStringInfoString(&buf, ";\n");
arcsCount = pg_reg_getnumoutarcs(regex, state); arcsCount = pg_reg_getnumoutarcs(regex, state);
arcs = (regex_arc_t *) palloc(sizeof(regex_arc_t) * arcsCount); arcs = (regex_arc_t *) palloc(sizeof(regex_arc_t) * arcsCount);
...@@ -1998,13 +1998,13 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors) ...@@ -1998,13 +1998,13 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
pfree(arcs); pfree(arcs);
} }
appendStringInfo(&buf, " node [shape = point ]; initial;\n"); appendStringInfoString(&buf, " node [shape = point ]; initial;\n");
appendStringInfo(&buf, " initial -> s%d;\n", appendStringInfo(&buf, " initial -> s%d;\n",
pg_reg_getinitialstate(regex)); pg_reg_getinitialstate(regex));
/* Print colors */ /* Print colors */
appendStringInfo(&buf, " { rank = sink;\n"); appendStringInfoString(&buf, " { rank = sink;\n");
appendStringInfo(&buf, " Colors [shape = none, margin=0, label=<\n"); appendStringInfoString(&buf, " Colors [shape = none, margin=0, label=<\n");
for (i = 0; i < ncolors; i++) for (i = 0; i < ncolors; i++)
{ {
...@@ -2020,17 +2020,17 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors) ...@@ -2020,17 +2020,17 @@ printSourceNFA(regex_t *regex, TrgmColorInfo *colors, int ncolors)
memcpy(s, color->wordChars[j].bytes, MAX_MULTIBYTE_CHAR_LEN); memcpy(s, color->wordChars[j].bytes, MAX_MULTIBYTE_CHAR_LEN);
s[MAX_MULTIBYTE_CHAR_LEN] = '\0'; s[MAX_MULTIBYTE_CHAR_LEN] = '\0';
appendStringInfo(&buf, "%s", s); appendStringInfoString(&buf, s);
} }
} }
else else
appendStringInfo(&buf, "not expandable"); appendStringInfoString(&buf, "not expandable");
appendStringInfo(&buf, "\n"); appendStringInfoChar(&buf, '\n');
} }
appendStringInfo(&buf, " >];\n"); appendStringInfoString(&buf, " >];\n");
appendStringInfo(&buf, " }\n"); appendStringInfoString(&buf, " }\n");
appendStringInfo(&buf, "}\n"); appendStringInfoString(&buf, "}\n");
{ {
/* dot -Tpng -o /tmp/source.png < /tmp/source.dot */ /* dot -Tpng -o /tmp/source.png < /tmp/source.dot */
...@@ -2056,7 +2056,7 @@ printTrgmNFA(TrgmNFA *trgmNFA) ...@@ -2056,7 +2056,7 @@ printTrgmNFA(TrgmNFA *trgmNFA)
initStringInfo(&buf); initStringInfo(&buf);
appendStringInfo(&buf, "\ndigraph transformedNFA {\n"); appendStringInfoString(&buf, "\ndigraph transformedNFA {\n");
hash_seq_init(&scan_status, trgmNFA->states); hash_seq_init(&scan_status, trgmNFA->states);
while ((state = (TrgmState *) hash_seq_search(&scan_status)) != NULL) while ((state = (TrgmState *) hash_seq_search(&scan_status)) != NULL)
...@@ -2065,11 +2065,11 @@ printTrgmNFA(TrgmNFA *trgmNFA) ...@@ -2065,11 +2065,11 @@ printTrgmNFA(TrgmNFA *trgmNFA)
appendStringInfo(&buf, "s%p", (void *) state); appendStringInfo(&buf, "s%p", (void *) state);
if (state->fin) if (state->fin)
appendStringInfo(&buf, " [shape = doublecircle]"); appendStringInfoString(&buf, " [shape = doublecircle]");
if (state->init) if (state->init)
initstate = state; initstate = state;
appendStringInfo(&buf, " [label = \"%d\"]", state->stateKey.nstate); appendStringInfo(&buf, " [label = \"%d\"]", state->stateKey.nstate);
appendStringInfo(&buf, ";\n"); appendStringInfoString(&buf, ";\n");
foreach(cell, state->arcs) foreach(cell, state->arcs)
{ {
...@@ -2078,21 +2078,21 @@ printTrgmNFA(TrgmNFA *trgmNFA) ...@@ -2078,21 +2078,21 @@ printTrgmNFA(TrgmNFA *trgmNFA)
appendStringInfo(&buf, " s%p -> s%p [label = \"", appendStringInfo(&buf, " s%p -> s%p [label = \"",
(void *) state, (void *) arc->target); (void *) state, (void *) arc->target);
printTrgmColor(&buf, arc->ctrgm.colors[0]); printTrgmColor(&buf, arc->ctrgm.colors[0]);
appendStringInfo(&buf, " "); appendStringInfoChar(&buf, ' ');
printTrgmColor(&buf, arc->ctrgm.colors[1]); printTrgmColor(&buf, arc->ctrgm.colors[1]);
appendStringInfo(&buf, " "); appendStringInfoChar(&buf, ' ');
printTrgmColor(&buf, arc->ctrgm.colors[2]); printTrgmColor(&buf, arc->ctrgm.colors[2]);
appendStringInfo(&buf, "\"];\n"); appendStringInfoString(&buf, "\"];\n");
} }
} }
if (initstate) 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, " initial -> s%p;\n", (void *) initstate);
} }
appendStringInfo(&buf, "}\n"); appendStringInfoString(&buf, "}\n");
{ {
/* dot -Tpng -o /tmp/transformed.png < /tmp/transformed.dot */ /* dot -Tpng -o /tmp/transformed.png < /tmp/transformed.dot */
...@@ -2112,9 +2112,9 @@ static void ...@@ -2112,9 +2112,9 @@ static void
printTrgmColor(StringInfo buf, TrgmColor co) printTrgmColor(StringInfo buf, TrgmColor co)
{ {
if (co == COLOR_UNKNOWN) if (co == COLOR_UNKNOWN)
appendStringInfo(buf, "u"); appendStringInfoChar(buf, 'u');
else if (co == COLOR_BLANK) else if (co == COLOR_BLANK)
appendStringInfo(buf, "b"); appendStringInfoChar(buf, 'b');
else else
appendStringInfo(buf, "%d", (int) co); appendStringInfo(buf, "%d", (int) co);
} }
...@@ -2131,7 +2131,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams) ...@@ -2131,7 +2131,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
initStringInfo(&buf); initStringInfo(&buf);
appendStringInfo(&buf, "\ndigraph packedGraph {\n"); appendStringInfoString(&buf, "\ndigraph packedGraph {\n");
for (i = 0; i < packedGraph->statesCount; i++) for (i = 0; i < packedGraph->statesCount; i++)
{ {
...@@ -2140,7 +2140,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams) ...@@ -2140,7 +2140,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
appendStringInfo(&buf, " s%d", i); appendStringInfo(&buf, " s%d", i);
if (i == 1) if (i == 1)
appendStringInfo(&buf, " [shape = doublecircle]"); appendStringInfoString(&buf, " [shape = doublecircle]");
appendStringInfo(&buf, " [label = <s%d>];\n", i); appendStringInfo(&buf, " [label = <s%d>];\n", i);
...@@ -2153,12 +2153,12 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams) ...@@ -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); appendStringInfo(&buf, " initial -> s%d;\n", 0);
/* Print trigrams */ /* Print trigrams */
appendStringInfo(&buf, " { rank = sink;\n"); appendStringInfoString(&buf, " { rank = sink;\n");
appendStringInfo(&buf, " Trigrams [shape = none, margin=0, label=<\n"); appendStringInfoString(&buf, " Trigrams [shape = none, margin=0, label=<\n");
p = GETARR(trigrams); p = GETARR(trigrams);
for (i = 0; i < packedGraph->colorTrigramsCount; i++) for (i = 0; i < packedGraph->colorTrigramsCount; i++)
...@@ -2171,7 +2171,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams) ...@@ -2171,7 +2171,7 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
for (j = 0; j < count; j++) for (j = 0; j < count; j++)
{ {
if (j > 0) if (j > 0)
appendStringInfo(&buf, ", "); appendStringInfoString(&buf, ", ");
/* /*
* XXX This representation is nice only for all-ASCII trigrams. * XXX This representation is nice only for all-ASCII trigrams.
...@@ -2181,9 +2181,9 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams) ...@@ -2181,9 +2181,9 @@ printTrgmPackedGraph(TrgmPackedGraph *packedGraph, TRGM *trigrams)
} }
} }
appendStringInfo(&buf, " >];\n"); appendStringInfoString(&buf, " >];\n");
appendStringInfo(&buf, " }\n"); appendStringInfoString(&buf, " }\n");
appendStringInfo(&buf, "}\n"); appendStringInfoString(&buf, "}\n");
{ {
/* dot -Tpng -o /tmp/packed.png < /tmp/packed.dot */ /* dot -Tpng -o /tmp/packed.png < /tmp/packed.dot */
......
...@@ -841,7 +841,7 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root, ...@@ -841,7 +841,7 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root,
if (targetAttrs) if (targetAttrs)
{ {
appendStringInfoString(buf, "("); appendStringInfoChar(buf, '(');
first = true; first = true;
foreach(lc, targetAttrs) foreach(lc, targetAttrs)
...@@ -869,7 +869,7 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root, ...@@ -869,7 +869,7 @@ deparseInsertSql(StringInfo buf, PlannerInfo *root,
pindex++; pindex++;
} }
appendStringInfoString(buf, ")"); appendStringInfoChar(buf, ')');
} }
else else
appendStringInfoString(buf, " DEFAULT VALUES"); appendStringInfoString(buf, " DEFAULT VALUES");
...@@ -989,7 +989,7 @@ deparseAnalyzeSizeSql(StringInfo buf, Relation rel) ...@@ -989,7 +989,7 @@ deparseAnalyzeSizeSql(StringInfo buf, Relation rel)
initStringInfo(&relname); initStringInfo(&relname);
deparseRelation(&relname, rel); deparseRelation(&relname, rel);
appendStringInfo(buf, "SELECT pg_catalog.pg_relation_size("); appendStringInfoString(buf, "SELECT pg_catalog.pg_relation_size(");
deparseStringLiteral(buf, relname.data); deparseStringLiteral(buf, relname.data);
appendStringInfo(buf, "::pg_catalog.regclass) / %d", BLCKSZ); appendStringInfo(buf, "::pg_catalog.regclass) / %d", BLCKSZ);
} }
...@@ -1302,7 +1302,7 @@ deparseConst(Const *node, deparse_expr_cxt *context) ...@@ -1302,7 +1302,7 @@ deparseConst(Const *node, deparse_expr_cxt *context)
if (node->constisnull) if (node->constisnull)
{ {
appendStringInfo(buf, "NULL"); appendStringInfoString(buf, "NULL");
appendStringInfo(buf, "::%s", appendStringInfo(buf, "::%s",
format_type_with_typemod(node->consttype, format_type_with_typemod(node->consttype,
node->consttypmod)); node->consttypmod));
...@@ -1650,7 +1650,7 @@ deparseOperatorName(StringInfo buf, Form_pg_operator opform) ...@@ -1650,7 +1650,7 @@ deparseOperatorName(StringInfo buf, Form_pg_operator opform)
else else
{ {
/* Just print operator name. */ /* Just print operator name. */
appendStringInfo(buf, "%s", opname); appendStringInfoString(buf, opname);
} }
} }
......
...@@ -787,7 +787,7 @@ postgresGetForeignPlan(PlannerInfo *root, ...@@ -787,7 +787,7 @@ postgresGetForeignPlan(PlannerInfo *root,
root->parse->commandType == CMD_DELETE)) root->parse->commandType == CMD_DELETE))
{ {
/* Relation is UPDATE/DELETE target, so use FOR UPDATE */ /* Relation is UPDATE/DELETE target, so use FOR UPDATE */
appendStringInfo(&sql, " FOR UPDATE"); appendStringInfoString(&sql, " FOR UPDATE");
} }
else else
{ {
...@@ -808,11 +808,11 @@ postgresGetForeignPlan(PlannerInfo *root, ...@@ -808,11 +808,11 @@ postgresGetForeignPlan(PlannerInfo *root,
{ {
case LCS_FORKEYSHARE: case LCS_FORKEYSHARE:
case LCS_FORSHARE: case LCS_FORSHARE:
appendStringInfo(&sql, " FOR SHARE"); appendStringInfoString(&sql, " FOR SHARE");
break; break;
case LCS_FORNOKEYUPDATE: case LCS_FORNOKEYUPDATE:
case LCS_FORUPDATE: case LCS_FORUPDATE:
appendStringInfo(&sql, " FOR UPDATE"); appendStringInfoString(&sql, " FOR UPDATE");
break; break;
} }
} }
......
...@@ -1340,7 +1340,7 @@ build_tuplestore_recursively(char *key_fld, ...@@ -1340,7 +1340,7 @@ build_tuplestore_recursively(char *key_fld,
for (i = 0; i < proc; i++) for (i = 0; i < proc; i++)
{ {
/* initialize branch for this pass */ /* initialize branch for this pass */
appendStringInfo(&branchstr, "%s", branch); appendStringInfoString(&branchstr, branch);
appendStringInfo(&chk_branchstr, "%s%s%s", branch_delim, branch, branch_delim); appendStringInfo(&chk_branchstr, "%s%s%s", branch_delim, branch, branch_delim);
/* get the next sql result tuple */ /* get the next sql result tuple */
......
...@@ -37,5 +37,5 @@ clog_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -37,5 +37,5 @@ clog_desc(StringInfo buf, uint8 xl_info, char *rec)
appendStringInfo(buf, "truncate before: %d", pageno); appendStringInfo(buf, "truncate before: %d", pageno);
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -39,5 +39,5 @@ dbase_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -39,5 +39,5 @@ dbase_desc(StringInfo buf, uint8 xl_info, char *rec)
xlrec->db_id, xlrec->tablespace_id); xlrec->db_id, xlrec->tablespace_id);
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -33,15 +33,15 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -33,15 +33,15 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
switch (info) switch (info)
{ {
case XLOG_GIN_CREATE_INDEX: case XLOG_GIN_CREATE_INDEX:
appendStringInfo(buf, "Create index, "); appendStringInfoString(buf, "Create index, ");
desc_node(buf, *(RelFileNode *) rec, GIN_ROOT_BLKNO); desc_node(buf, *(RelFileNode *) rec, GIN_ROOT_BLKNO);
break; break;
case XLOG_GIN_CREATE_PTREE: case XLOG_GIN_CREATE_PTREE:
appendStringInfo(buf, "Create posting tree, "); appendStringInfoString(buf, "Create posting tree, ");
desc_node(buf, ((ginxlogCreatePostingTree *) rec)->node, ((ginxlogCreatePostingTree *) rec)->blkno); desc_node(buf, ((ginxlogCreatePostingTree *) rec)->node, ((ginxlogCreatePostingTree *) rec)->blkno);
break; break;
case XLOG_GIN_INSERT: case XLOG_GIN_INSERT:
appendStringInfo(buf, "Insert item, "); appendStringInfoString(buf, "Insert item, ");
desc_node(buf, ((ginxlogInsert *) rec)->node, ((ginxlogInsert *) rec)->blkno); desc_node(buf, ((ginxlogInsert *) rec)->node, ((ginxlogInsert *) rec)->blkno);
appendStringInfo(buf, " offset: %u nitem: %u isdata: %c isleaf %c isdelete %c updateBlkno:%u", appendStringInfo(buf, " offset: %u nitem: %u isdata: %c isleaf %c isdelete %c updateBlkno:%u",
((ginxlogInsert *) rec)->offset, ((ginxlogInsert *) rec)->offset,
...@@ -52,24 +52,24 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -52,24 +52,24 @@ gin_desc(StringInfo buf, uint8 xl_info, char *rec)
((ginxlogInsert *) rec)->updateBlkno); ((ginxlogInsert *) rec)->updateBlkno);
break; break;
case XLOG_GIN_SPLIT: case XLOG_GIN_SPLIT:
appendStringInfo(buf, "Page split, "); appendStringInfoString(buf, "Page split, ");
desc_node(buf, ((ginxlogSplit *) rec)->node, ((ginxlogSplit *) rec)->lblkno); desc_node(buf, ((ginxlogSplit *) rec)->node, ((ginxlogSplit *) rec)->lblkno);
appendStringInfo(buf, " isrootsplit: %c", (((ginxlogSplit *) rec)->isRootSplit) ? 'T' : 'F'); appendStringInfo(buf, " isrootsplit: %c", (((ginxlogSplit *) rec)->isRootSplit) ? 'T' : 'F');
break; break;
case XLOG_GIN_VACUUM_PAGE: case XLOG_GIN_VACUUM_PAGE:
appendStringInfo(buf, "Vacuum page, "); appendStringInfoString(buf, "Vacuum page, ");
desc_node(buf, ((ginxlogVacuumPage *) rec)->node, ((ginxlogVacuumPage *) rec)->blkno); desc_node(buf, ((ginxlogVacuumPage *) rec)->node, ((ginxlogVacuumPage *) rec)->blkno);
break; break;
case XLOG_GIN_DELETE_PAGE: case XLOG_GIN_DELETE_PAGE:
appendStringInfo(buf, "Delete page, "); appendStringInfoString(buf, "Delete page, ");
desc_node(buf, ((ginxlogDeletePage *) rec)->node, ((ginxlogDeletePage *) rec)->blkno); desc_node(buf, ((ginxlogDeletePage *) rec)->node, ((ginxlogDeletePage *) rec)->blkno);
break; break;
case XLOG_GIN_UPDATE_META_PAGE: case XLOG_GIN_UPDATE_META_PAGE:
appendStringInfo(buf, "Update metapage, "); appendStringInfoString(buf, "Update metapage, ");
desc_node(buf, ((ginxlogUpdateMeta *) rec)->node, GIN_METAPAGE_BLKNO); desc_node(buf, ((ginxlogUpdateMeta *) rec)->node, GIN_METAPAGE_BLKNO);
break; break;
case XLOG_GIN_INSERT_LISTPAGE: 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); desc_node(buf, ((ginxlogInsertListPage *) rec)->node, ((ginxlogInsertListPage *) rec)->blkno);
break; break;
case XLOG_GIN_DELETE_LISTPAGE: case XLOG_GIN_DELETE_LISTPAGE:
......
...@@ -35,7 +35,7 @@ out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec) ...@@ -35,7 +35,7 @@ out_gistxlogPageUpdate(StringInfo buf, gistxlogPageUpdate *xlrec)
static void static void
out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec) out_gistxlogPageSplit(StringInfo buf, gistxlogPageSplit *xlrec)
{ {
appendStringInfo(buf, "page_split: "); appendStringInfoString(buf, "page_split: ");
out_target(buf, xlrec->node); out_target(buf, xlrec->node);
appendStringInfo(buf, "; block number %u splits to %d pages", appendStringInfo(buf, "; block number %u splits to %d pages",
xlrec->origblkno, xlrec->npage); xlrec->origblkno, xlrec->npage);
...@@ -49,7 +49,7 @@ gist_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -49,7 +49,7 @@ gist_desc(StringInfo buf, uint8 xl_info, char *rec)
switch (info) switch (info)
{ {
case XLOG_GIST_PAGE_UPDATE: case XLOG_GIST_PAGE_UPDATE:
appendStringInfo(buf, "page_update: "); appendStringInfoString(buf, "page_update: ");
out_gistxlogPageUpdate(buf, (gistxlogPageUpdate *) rec); out_gistxlogPageUpdate(buf, (gistxlogPageUpdate *) rec);
break; break;
case XLOG_GIST_PAGE_SPLIT: case XLOG_GIST_PAGE_SPLIT:
......
...@@ -29,15 +29,15 @@ static void ...@@ -29,15 +29,15 @@ static void
out_infobits(StringInfo buf, uint8 infobits) out_infobits(StringInfo buf, uint8 infobits)
{ {
if (infobits & XLHL_XMAX_IS_MULTI) if (infobits & XLHL_XMAX_IS_MULTI)
appendStringInfo(buf, "IS_MULTI "); appendStringInfoString(buf, "IS_MULTI ");
if (infobits & XLHL_XMAX_LOCK_ONLY) if (infobits & XLHL_XMAX_LOCK_ONLY)
appendStringInfo(buf, "LOCK_ONLY "); appendStringInfoString(buf, "LOCK_ONLY ");
if (infobits & XLHL_XMAX_EXCL_LOCK) if (infobits & XLHL_XMAX_EXCL_LOCK)
appendStringInfo(buf, "EXCL_LOCK "); appendStringInfoString(buf, "EXCL_LOCK ");
if (infobits & XLHL_XMAX_KEYSHR_LOCK) if (infobits & XLHL_XMAX_KEYSHR_LOCK)
appendStringInfo(buf, "KEYSHR_LOCK "); appendStringInfoString(buf, "KEYSHR_LOCK ");
if (infobits & XLHL_KEYS_UPDATED) if (infobits & XLHL_KEYS_UPDATED)
appendStringInfo(buf, "KEYS_UPDATED "); appendStringInfoString(buf, "KEYS_UPDATED ");
} }
void void
...@@ -51,16 +51,16 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -51,16 +51,16 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_heap_insert *xlrec = (xl_heap_insert *) rec; xl_heap_insert *xlrec = (xl_heap_insert *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE) if (xl_info & XLOG_HEAP_INIT_PAGE)
appendStringInfo(buf, "insert(init): "); appendStringInfoString(buf, "insert(init): ");
else else
appendStringInfo(buf, "insert: "); appendStringInfoString(buf, "insert: ");
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
} }
else if (info == XLOG_HEAP_DELETE) else if (info == XLOG_HEAP_DELETE)
{ {
xl_heap_delete *xlrec = (xl_heap_delete *) rec; xl_heap_delete *xlrec = (xl_heap_delete *) rec;
appendStringInfo(buf, "delete: "); appendStringInfoString(buf, "delete: ");
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
appendStringInfoChar(buf, ' '); appendStringInfoChar(buf, ' ');
out_infobits(buf, xlrec->infobits_set); out_infobits(buf, xlrec->infobits_set);
...@@ -70,9 +70,9 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -70,9 +70,9 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_heap_update *xlrec = (xl_heap_update *) rec; xl_heap_update *xlrec = (xl_heap_update *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE) if (xl_info & XLOG_HEAP_INIT_PAGE)
appendStringInfo(buf, "update(init): "); appendStringInfoString(buf, "update(init): ");
else else
appendStringInfo(buf, "update: "); appendStringInfoString(buf, "update: ");
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
appendStringInfo(buf, " xmax %u ", xlrec->old_xmax); appendStringInfo(buf, " xmax %u ", xlrec->old_xmax);
out_infobits(buf, xlrec->old_infobits_set); out_infobits(buf, xlrec->old_infobits_set);
...@@ -86,9 +86,9 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -86,9 +86,9 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_heap_update *xlrec = (xl_heap_update *) rec; xl_heap_update *xlrec = (xl_heap_update *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE) /* can this case happen? */ if (xl_info & XLOG_HEAP_INIT_PAGE) /* can this case happen? */
appendStringInfo(buf, "hot_update(init): "); appendStringInfoString(buf, "hot_update(init): ");
else else
appendStringInfo(buf, "hot_update: "); appendStringInfoString(buf, "hot_update: ");
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
appendStringInfo(buf, " xmax %u ", xlrec->old_xmax); appendStringInfo(buf, " xmax %u ", xlrec->old_xmax);
out_infobits(buf, xlrec->old_infobits_set); out_infobits(buf, xlrec->old_infobits_set);
...@@ -119,11 +119,11 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -119,11 +119,11 @@ heap_desc(StringInfo buf, uint8 xl_info, char *rec)
{ {
xl_heap_inplace *xlrec = (xl_heap_inplace *) rec; xl_heap_inplace *xlrec = (xl_heap_inplace *) rec;
appendStringInfo(buf, "inplace: "); appendStringInfoString(buf, "inplace: ");
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
void void
heap2_desc(StringInfo buf, uint8 xl_info, char *rec) heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
...@@ -169,9 +169,9 @@ 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; xl_heap_multi_insert *xlrec = (xl_heap_multi_insert *) rec;
if (xl_info & XLOG_HEAP_INIT_PAGE) if (xl_info & XLOG_HEAP_INIT_PAGE)
appendStringInfo(buf, "multi-insert (init): "); appendStringInfoString(buf, "multi-insert (init): ");
else else
appendStringInfo(buf, "multi-insert: "); appendStringInfoString(buf, "multi-insert: ");
appendStringInfo(buf, "rel %u/%u/%u; blk %u; %d tuples", appendStringInfo(buf, "rel %u/%u/%u; blk %u; %d tuples",
xlrec->node.spcNode, xlrec->node.dbNode, xlrec->node.relNode, xlrec->node.spcNode, xlrec->node.dbNode, xlrec->node.relNode,
xlrec->blkno, xlrec->ntuples); xlrec->blkno, xlrec->ntuples);
...@@ -185,5 +185,5 @@ heap2_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -185,5 +185,5 @@ heap2_desc(StringInfo buf, uint8 xl_info, char *rec)
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -76,5 +76,5 @@ multixact_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -76,5 +76,5 @@ multixact_desc(StringInfo buf, uint8 xl_info, char *rec)
out_member(buf, &xlrec->members[i]); out_member(buf, &xlrec->members[i]);
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -36,7 +36,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -36,7 +36,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
{ {
xl_btree_insert *xlrec = (xl_btree_insert *) rec; xl_btree_insert *xlrec = (xl_btree_insert *) rec;
appendStringInfo(buf, "insert: "); appendStringInfoString(buf, "insert: ");
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
break; break;
} }
...@@ -44,7 +44,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -44,7 +44,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
{ {
xl_btree_insert *xlrec = (xl_btree_insert *) rec; xl_btree_insert *xlrec = (xl_btree_insert *) rec;
appendStringInfo(buf, "insert_upper: "); appendStringInfoString(buf, "insert_upper: ");
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
break; break;
} }
...@@ -52,7 +52,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -52,7 +52,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
{ {
xl_btree_insert *xlrec = (xl_btree_insert *) rec; xl_btree_insert *xlrec = (xl_btree_insert *) rec;
appendStringInfo(buf, "insert_meta: "); appendStringInfoString(buf, "insert_meta: ");
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
break; break;
} }
...@@ -130,7 +130,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -130,7 +130,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
{ {
xl_btree_delete_page *xlrec = (xl_btree_delete_page *) rec; xl_btree_delete_page *xlrec = (xl_btree_delete_page *) rec;
appendStringInfo(buf, "delete_page: "); appendStringInfoString(buf, "delete_page: ");
out_target(buf, &(xlrec->target)); out_target(buf, &(xlrec->target));
appendStringInfo(buf, "; dead %u; left %u; right %u", appendStringInfo(buf, "; dead %u; left %u; right %u",
xlrec->deadblk, xlrec->leftblk, xlrec->rightblk); xlrec->deadblk, xlrec->leftblk, xlrec->rightblk);
...@@ -156,7 +156,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -156,7 +156,7 @@ btree_desc(StringInfo buf, uint8 xl_info, char *rec)
break; break;
} }
default: default:
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
break; break;
} }
} }
...@@ -29,5 +29,5 @@ relmap_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -29,5 +29,5 @@ relmap_desc(StringInfo buf, uint8 xl_info, char *rec)
xlrec->dbid, xlrec->tsid, xlrec->nbytes); xlrec->dbid, xlrec->tsid, xlrec->nbytes);
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -24,10 +24,10 @@ seq_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -24,10 +24,10 @@ seq_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_seq_rec *xlrec = (xl_seq_rec *) rec; xl_seq_rec *xlrec = (xl_seq_rec *) rec;
if (info == XLOG_SEQ_LOG) if (info == XLOG_SEQ_LOG)
appendStringInfo(buf, "log: "); appendStringInfoString(buf, "log: ");
else else
{ {
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
return; return;
} }
......
...@@ -42,5 +42,5 @@ smgr_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -42,5 +42,5 @@ smgr_desc(StringInfo buf, uint8 xl_info, char *rec)
pfree(path); pfree(path);
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -64,7 +64,7 @@ spg_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -64,7 +64,7 @@ spg_desc(StringInfo buf, uint8 xl_info, char *rec)
break; break;
case XLOG_SPGIST_PICKSPLIT: case XLOG_SPGIST_PICKSPLIT:
out_target(buf, ((spgxlogPickSplit *) rec)->node); out_target(buf, ((spgxlogPickSplit *) rec)->node);
appendStringInfo(buf, "split leaf page"); appendStringInfoString(buf, "split leaf page");
break; break;
case XLOG_SPGIST_VACUUM_LEAF: case XLOG_SPGIST_VACUUM_LEAF:
out_target(buf, ((spgxlogVacuumLeaf *) rec)->node); out_target(buf, ((spgxlogVacuumLeaf *) rec)->node);
......
...@@ -33,7 +33,7 @@ standby_desc_running_xacts(StringInfo buf, xl_running_xacts *xlrec) ...@@ -33,7 +33,7 @@ standby_desc_running_xacts(StringInfo buf, xl_running_xacts *xlrec)
} }
if (xlrec->subxid_overflow) if (xlrec->subxid_overflow)
appendStringInfo(buf, "; subxid ovf"); appendStringInfoString(buf, "; subxid ovf");
} }
void void
...@@ -46,7 +46,7 @@ standby_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -46,7 +46,7 @@ standby_desc(StringInfo buf, uint8 xl_info, char *rec)
xl_standby_locks *xlrec = (xl_standby_locks *) rec; xl_standby_locks *xlrec = (xl_standby_locks *) rec;
int i; int i;
appendStringInfo(buf, "AccessExclusive locks:"); appendStringInfoString(buf, "AccessExclusive locks:");
for (i = 0; i < xlrec->nlocks; i++) for (i = 0; i < xlrec->nlocks; i++)
appendStringInfo(buf, " xid %u db %u rel %u", appendStringInfo(buf, " xid %u db %u rel %u",
...@@ -57,9 +57,9 @@ standby_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -57,9 +57,9 @@ standby_desc(StringInfo buf, uint8 xl_info, char *rec)
{ {
xl_running_xacts *xlrec = (xl_running_xacts *) rec; xl_running_xacts *xlrec = (xl_running_xacts *) rec;
appendStringInfo(buf, "running xacts:"); appendStringInfoString(buf, "running xacts:");
standby_desc_running_xacts(buf, xlrec); standby_desc_running_xacts(buf, xlrec);
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -36,5 +36,5 @@ tblspc_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -36,5 +36,5 @@ tblspc_desc(StringInfo buf, uint8 xl_info, char *rec)
appendStringInfo(buf, "drop tablespace: %u", xlrec->ts_id); appendStringInfo(buf, "drop tablespace: %u", xlrec->ts_id);
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -33,7 +33,7 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec) ...@@ -33,7 +33,7 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
if (xlrec->nrels > 0) if (xlrec->nrels > 0)
{ {
appendStringInfo(buf, "; rels:"); appendStringInfoString(buf, "; rels:");
for (i = 0; i < xlrec->nrels; i++) for (i = 0; i < xlrec->nrels; i++)
{ {
char *path = relpathperm(xlrec->xnodes[i], MAIN_FORKNUM); char *path = relpathperm(xlrec->xnodes[i], MAIN_FORKNUM);
...@@ -44,7 +44,7 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec) ...@@ -44,7 +44,7 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
} }
if (xlrec->nsubxacts > 0) if (xlrec->nsubxacts > 0)
{ {
appendStringInfo(buf, "; subxacts:"); appendStringInfoString(buf, "; subxacts:");
for (i = 0; i < xlrec->nsubxacts; i++) for (i = 0; i < xlrec->nsubxacts; i++)
appendStringInfo(buf, " %u", subxacts[i]); appendStringInfo(buf, " %u", subxacts[i]);
} }
...@@ -58,7 +58,7 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec) ...@@ -58,7 +58,7 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
appendStringInfo(buf, "; relcache init file inval dbid %u tsid %u", appendStringInfo(buf, "; relcache init file inval dbid %u tsid %u",
xlrec->dbId, xlrec->tsId); xlrec->dbId, xlrec->tsId);
appendStringInfo(buf, "; inval msgs:"); appendStringInfoString(buf, "; inval msgs:");
for (i = 0; i < xlrec->nmsgs; i++) for (i = 0; i < xlrec->nmsgs; i++)
{ {
SharedInvalidationMessage *msg = &msgs[i]; SharedInvalidationMessage *msg = &msgs[i];
...@@ -71,10 +71,10 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec) ...@@ -71,10 +71,10 @@ xact_desc_commit(StringInfo buf, xl_xact_commit *xlrec)
appendStringInfo(buf, " relcache %u", msg->rc.relId); appendStringInfo(buf, " relcache %u", msg->rc.relId);
/* not expected, but print something anyway */ /* not expected, but print something anyway */
else if (msg->id == SHAREDINVALSMGR_ID) else if (msg->id == SHAREDINVALSMGR_ID)
appendStringInfo(buf, " smgr"); appendStringInfoString(buf, " smgr");
/* not expected, but print something anyway */ /* not expected, but print something anyway */
else if (msg->id == SHAREDINVALRELMAP_ID) else if (msg->id == SHAREDINVALRELMAP_ID)
appendStringInfo(buf, " relmap"); appendStringInfoString(buf, " relmap");
else if (msg->id == SHAREDINVALSNAPSHOT_ID) else if (msg->id == SHAREDINVALSNAPSHOT_ID)
appendStringInfo(buf, " snapshot %u", msg->sn.relId); appendStringInfo(buf, " snapshot %u", msg->sn.relId);
else else
...@@ -92,7 +92,7 @@ xact_desc_commit_compact(StringInfo buf, xl_xact_commit_compact *xlrec) ...@@ -92,7 +92,7 @@ xact_desc_commit_compact(StringInfo buf, xl_xact_commit_compact *xlrec)
if (xlrec->nsubxacts > 0) if (xlrec->nsubxacts > 0)
{ {
appendStringInfo(buf, "; subxacts:"); appendStringInfoString(buf, "; subxacts:");
for (i = 0; i < xlrec->nsubxacts; i++) for (i = 0; i < xlrec->nsubxacts; i++)
appendStringInfo(buf, " %u", xlrec->subxacts[i]); appendStringInfo(buf, " %u", xlrec->subxacts[i]);
} }
...@@ -106,7 +106,7 @@ xact_desc_abort(StringInfo buf, xl_xact_abort *xlrec) ...@@ -106,7 +106,7 @@ xact_desc_abort(StringInfo buf, xl_xact_abort *xlrec)
appendStringInfoString(buf, timestamptz_to_str(xlrec->xact_time)); appendStringInfoString(buf, timestamptz_to_str(xlrec->xact_time));
if (xlrec->nrels > 0) if (xlrec->nrels > 0)
{ {
appendStringInfo(buf, "; rels:"); appendStringInfoString(buf, "; rels:");
for (i = 0; i < xlrec->nrels; i++) for (i = 0; i < xlrec->nrels; i++)
{ {
char *path = relpathperm(xlrec->xnodes[i], MAIN_FORKNUM); char *path = relpathperm(xlrec->xnodes[i], MAIN_FORKNUM);
...@@ -120,7 +120,7 @@ xact_desc_abort(StringInfo buf, xl_xact_abort *xlrec) ...@@ -120,7 +120,7 @@ xact_desc_abort(StringInfo buf, xl_xact_abort *xlrec)
TransactionId *xacts = (TransactionId *) TransactionId *xacts = (TransactionId *)
&xlrec->xnodes[xlrec->nrels]; &xlrec->xnodes[xlrec->nrels];
appendStringInfo(buf, "; subxacts:"); appendStringInfoString(buf, "; subxacts:");
for (i = 0; i < xlrec->nsubxacts; i++) for (i = 0; i < xlrec->nsubxacts; i++)
appendStringInfo(buf, " %u", xacts[i]); appendStringInfo(buf, " %u", xacts[i]);
} }
...@@ -131,7 +131,7 @@ xact_desc_assignment(StringInfo buf, xl_xact_assignment *xlrec) ...@@ -131,7 +131,7 @@ xact_desc_assignment(StringInfo buf, xl_xact_assignment *xlrec)
{ {
int i; int i;
appendStringInfo(buf, "subxacts:"); appendStringInfoString(buf, "subxacts:");
for (i = 0; i < xlrec->nsubxacts; i++) for (i = 0; i < xlrec->nsubxacts; i++)
appendStringInfo(buf, " %u", xlrec->xsub[i]); appendStringInfo(buf, " %u", xlrec->xsub[i]);
...@@ -146,26 +146,26 @@ xact_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -146,26 +146,26 @@ xact_desc(StringInfo buf, uint8 xl_info, char *rec)
{ {
xl_xact_commit_compact *xlrec = (xl_xact_commit_compact *) rec; xl_xact_commit_compact *xlrec = (xl_xact_commit_compact *) rec;
appendStringInfo(buf, "commit: "); appendStringInfoString(buf, "commit: ");
xact_desc_commit_compact(buf, xlrec); xact_desc_commit_compact(buf, xlrec);
} }
else if (info == XLOG_XACT_COMMIT) else if (info == XLOG_XACT_COMMIT)
{ {
xl_xact_commit *xlrec = (xl_xact_commit *) rec; xl_xact_commit *xlrec = (xl_xact_commit *) rec;
appendStringInfo(buf, "commit: "); appendStringInfoString(buf, "commit: ");
xact_desc_commit(buf, xlrec); xact_desc_commit(buf, xlrec);
} }
else if (info == XLOG_XACT_ABORT) else if (info == XLOG_XACT_ABORT)
{ {
xl_xact_abort *xlrec = (xl_xact_abort *) rec; xl_xact_abort *xlrec = (xl_xact_abort *) rec;
appendStringInfo(buf, "abort: "); appendStringInfoString(buf, "abort: ");
xact_desc_abort(buf, xlrec); xact_desc_abort(buf, xlrec);
} }
else if (info == XLOG_XACT_PREPARE) else if (info == XLOG_XACT_PREPARE)
{ {
appendStringInfo(buf, "prepare"); appendStringInfoString(buf, "prepare");
} }
else if (info == XLOG_XACT_COMMIT_PREPARED) else if (info == XLOG_XACT_COMMIT_PREPARED)
{ {
...@@ -194,5 +194,5 @@ xact_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -194,5 +194,5 @@ xact_desc(StringInfo buf, uint8 xl_info, char *rec)
xact_desc_assignment(buf, xlrec); xact_desc_assignment(buf, xlrec);
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -62,7 +62,7 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -62,7 +62,7 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec)
} }
else if (info == XLOG_NOOP) else if (info == XLOG_NOOP)
{ {
appendStringInfo(buf, "xlog no-op"); appendStringInfoString(buf, "xlog no-op");
} }
else if (info == XLOG_NEXTOID) else if (info == XLOG_NEXTOID)
{ {
...@@ -73,7 +73,7 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -73,7 +73,7 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec)
} }
else if (info == XLOG_SWITCH) else if (info == XLOG_SWITCH)
{ {
appendStringInfo(buf, "xlog switch"); appendStringInfoString(buf, "xlog switch");
} }
else if (info == XLOG_RESTORE_POINT) else if (info == XLOG_RESTORE_POINT)
{ {
...@@ -141,5 +141,5 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec) ...@@ -141,5 +141,5 @@ xlog_desc(StringInfo buf, uint8 xl_info, char *rec)
timestamptz_to_str(xlrec.end_time)); timestamptz_to_str(xlrec.end_time));
} }
else else
appendStringInfo(buf, "UNKNOWN"); appendStringInfoString(buf, "UNKNOWN");
} }
...@@ -1248,7 +1248,7 @@ begin:; ...@@ -1248,7 +1248,7 @@ begin:;
xlog_outrec(&buf, rechdr); xlog_outrec(&buf, rechdr);
if (rdata->data != NULL) if (rdata->data != NULL)
{ {
appendStringInfo(&buf, " - "); appendStringInfoString(&buf, " - ");
RmgrTable[rechdr->xl_rmid].rm_desc(&buf, rechdr->xl_info, rdata->data); RmgrTable[rechdr->xl_rmid].rm_desc(&buf, rechdr->xl_info, rdata->data);
} }
elog(LOG, "%s", buf.data); elog(LOG, "%s", buf.data);
...@@ -6677,7 +6677,7 @@ StartupXLOG(void) ...@@ -6677,7 +6677,7 @@ StartupXLOG(void)
(uint32) (ReadRecPtr >> 32), (uint32) ReadRecPtr, (uint32) (ReadRecPtr >> 32), (uint32) ReadRecPtr,
(uint32) (EndRecPtr >> 32), (uint32) EndRecPtr); (uint32) (EndRecPtr >> 32), (uint32) EndRecPtr);
xlog_outrec(&buf, record); xlog_outrec(&buf, record);
appendStringInfo(&buf, " - "); appendStringInfoString(&buf, " - ");
RmgrTable[record->xl_rmid].rm_desc(&buf, RmgrTable[record->xl_rmid].rm_desc(&buf,
record->xl_info, record->xl_info,
XLogRecGetData(record)); XLogRecGetData(record));
......
This diff is collapsed.
...@@ -1087,7 +1087,7 @@ ExplainNode(PlanState *planstate, List *ancestors, ...@@ -1087,7 +1087,7 @@ ExplainNode(PlanState *planstate, List *ancestors,
if (((Join *) plan)->jointype != JOIN_INNER) if (((Join *) plan)->jointype != JOIN_INNER)
appendStringInfo(es->str, " %s Join", jointype); appendStringInfo(es->str, " %s Join", jointype);
else if (!IsA(plan, NestLoop)) else if (!IsA(plan, NestLoop))
appendStringInfo(es->str, " Join"); appendStringInfoString(es->str, " Join");
} }
else else
ExplainPropertyText("Join Type", jointype, es); ExplainPropertyText("Join Type", jointype, es);
...@@ -1182,7 +1182,7 @@ ExplainNode(PlanState *planstate, List *ancestors, ...@@ -1182,7 +1182,7 @@ ExplainNode(PlanState *planstate, List *ancestors,
{ {
if (es->format == EXPLAIN_FORMAT_TEXT) if (es->format == EXPLAIN_FORMAT_TEXT)
appendStringInfo(es->str, " (never executed)"); appendStringInfoString(es->str, " (never executed)");
else if (planstate->instrument->need_timer) else if (planstate->instrument->need_timer)
{ {
ExplainPropertyFloat("Actual Startup Time", 0.0, 3, es); ExplainPropertyFloat("Actual Startup Time", 0.0, 3, es);
......
...@@ -1523,7 +1523,7 @@ serialize_deflist(List *deflist) ...@@ -1523,7 +1523,7 @@ serialize_deflist(List *deflist)
} }
appendStringInfoChar(&buf, '\''); appendStringInfoChar(&buf, '\'');
if (lnext(l) != NULL) if (lnext(l) != NULL)
appendStringInfo(&buf, ", "); appendStringInfoString(&buf, ", ");
} }
result = cstring_to_text_with_len(buf.data, buf.len); result = cstring_to_text_with_len(buf.data, buf.len);
......
This diff is collapsed.
...@@ -4343,7 +4343,7 @@ ShowUsage(const char *title) ...@@ -4343,7 +4343,7 @@ ShowUsage(const char *title)
*/ */
initStringInfo(&str); initStringInfo(&str);
appendStringInfo(&str, "! system usage stats:\n"); appendStringInfoString(&str, "! system usage stats:\n");
appendStringInfo(&str, appendStringInfo(&str,
"!\t%ld.%06ld elapsed %ld.%06ld user %ld.%06ld system sec\n", "!\t%ld.%06ld elapsed %ld.%06ld user %ld.%06ld system sec\n",
(long) (elapse_t.tv_sec - Save_t.tv_sec), (long) (elapse_t.tv_sec - Save_t.tv_sec),
......
...@@ -716,7 +716,7 @@ format_operator_internal(Oid operator_oid, bool force_qualify) ...@@ -716,7 +716,7 @@ format_operator_internal(Oid operator_oid, bool force_qualify)
format_type_be_qualified(operform->oprleft) : format_type_be_qualified(operform->oprleft) :
format_type_be(operform->oprleft)); format_type_be(operform->oprleft));
else else
appendStringInfo(&buf, "NONE,"); appendStringInfoString(&buf, "NONE,");
if (operform->oprright) if (operform->oprright)
appendStringInfo(&buf, "%s)", appendStringInfo(&buf, "%s)",
...@@ -724,7 +724,7 @@ format_operator_internal(Oid operator_oid, bool force_qualify) ...@@ -724,7 +724,7 @@ format_operator_internal(Oid operator_oid, bool force_qualify)
format_type_be_qualified(operform->oprright) : format_type_be_qualified(operform->oprright) :
format_type_be(operform->oprright)); format_type_be(operform->oprright));
else else
appendStringInfo(&buf, "NONE)"); appendStringInfoString(&buf, "NONE)");
result = buf.data; result = buf.data;
......
...@@ -427,7 +427,7 @@ RI_FKey_check(TriggerData *trigdata) ...@@ -427,7 +427,7 @@ RI_FKey_check(TriggerData *trigdata)
querysep = "AND"; querysep = "AND";
queryoids[i] = fk_type; queryoids[i] = fk_type;
} }
appendStringInfo(&querybuf, " FOR KEY SHARE OF x"); appendStringInfoString(&querybuf, " FOR KEY SHARE OF x");
/* Prepare and save the plan */ /* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids, qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
...@@ -562,7 +562,7 @@ ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel, ...@@ -562,7 +562,7 @@ ri_Check_Pk_Match(Relation pk_rel, Relation fk_rel,
querysep = "AND"; querysep = "AND";
queryoids[i] = pk_type; queryoids[i] = pk_type;
} }
appendStringInfo(&querybuf, " FOR KEY SHARE OF x"); appendStringInfoString(&querybuf, " FOR KEY SHARE OF x");
/* Prepare and save the plan */ /* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids, qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
...@@ -754,7 +754,7 @@ ri_restrict_del(TriggerData *trigdata, bool is_no_action) ...@@ -754,7 +754,7 @@ ri_restrict_del(TriggerData *trigdata, bool is_no_action)
querysep = "AND"; querysep = "AND";
queryoids[i] = pk_type; queryoids[i] = pk_type;
} }
appendStringInfo(&querybuf, " FOR KEY SHARE OF x"); appendStringInfoString(&querybuf, " FOR KEY SHARE OF x");
/* Prepare and save the plan */ /* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids, qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
...@@ -977,7 +977,7 @@ ri_restrict_upd(TriggerData *trigdata, bool is_no_action) ...@@ -977,7 +977,7 @@ ri_restrict_upd(TriggerData *trigdata, bool is_no_action)
querysep = "AND"; querysep = "AND";
queryoids[i] = pk_type; queryoids[i] = pk_type;
} }
appendStringInfo(&querybuf, " FOR KEY SHARE OF x"); appendStringInfoString(&querybuf, " FOR KEY SHARE OF x");
/* Prepare and save the plan */ /* Prepare and save the plan */
qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids, qplan = ri_PlanCheck(querybuf.data, riinfo->nkeys, queryoids,
...@@ -2319,7 +2319,7 @@ RI_Initial_Check(Trigger *trigger, Relation fk_rel, Relation pk_rel) ...@@ -2319,7 +2319,7 @@ RI_Initial_Check(Trigger *trigger, Relation fk_rel, Relation pk_rel)
*---------- *----------
*/ */
initStringInfo(&querybuf); initStringInfo(&querybuf);
appendStringInfo(&querybuf, "SELECT "); appendStringInfoString(&querybuf, "SELECT ");
sep = ""; sep = "";
for (i = 0; i < riinfo->nkeys; i++) for (i = 0; i < riinfo->nkeys; i++)
{ {
...@@ -2391,7 +2391,7 @@ RI_Initial_Check(Trigger *trigger, Relation fk_rel, Relation pk_rel) ...@@ -2391,7 +2391,7 @@ RI_Initial_Check(Trigger *trigger, Relation fk_rel, Relation pk_rel)
break; break;
} }
} }
appendStringInfo(&querybuf, ")"); appendStringInfoChar(&querybuf, ')');
/* /*
* Temporarily increase work_mem so that the check query can be executed * Temporarily increase work_mem so that the check query can be executed
......
This diff is collapsed.
...@@ -442,9 +442,9 @@ xmlcomment(PG_FUNCTION_ARGS) ...@@ -442,9 +442,9 @@ xmlcomment(PG_FUNCTION_ARGS)
errmsg("invalid XML comment"))); errmsg("invalid XML comment")));
initStringInfo(&buf); initStringInfo(&buf);
appendStringInfo(&buf, "<!--"); appendStringInfoString(&buf, "<!--");
appendStringInfoText(&buf, arg); appendStringInfoText(&buf, arg);
appendStringInfo(&buf, "-->"); appendStringInfoString(&buf, "-->");
PG_RETURN_XML_P(stringinfo_to_xmltype(&buf)); PG_RETURN_XML_P(stringinfo_to_xmltype(&buf));
#else #else
...@@ -1852,19 +1852,19 @@ map_sql_identifier_to_xml_name(char *ident, bool fully_escaped, ...@@ -1852,19 +1852,19 @@ map_sql_identifier_to_xml_name(char *ident, bool fully_escaped,
for (p = ident; *p; p += pg_mblen(p)) for (p = ident; *p; p += pg_mblen(p))
{ {
if (*p == ':' && (p == ident || fully_escaped)) if (*p == ':' && (p == ident || fully_escaped))
appendStringInfo(&buf, "_x003A_"); appendStringInfoString(&buf, "_x003A_");
else if (*p == '_' && *(p + 1) == 'x') else if (*p == '_' && *(p + 1) == 'x')
appendStringInfo(&buf, "_x005F_"); appendStringInfoString(&buf, "_x005F_");
else if (fully_escaped && p == ident && else if (fully_escaped && p == ident &&
pg_strncasecmp(p, "xml", 3) == 0) pg_strncasecmp(p, "xml", 3) == 0)
{ {
if (*p == 'x') if (*p == 'x')
appendStringInfo(&buf, "_x0078_"); appendStringInfoString(&buf, "_x0078_");
else else
appendStringInfo(&buf, "_x0058_"); appendStringInfoString(&buf, "_x0058_");
} }
else if (escape_period && *p == '.') else if (escape_period && *p == '.')
appendStringInfo(&buf, "_x002E_"); appendStringInfoString(&buf, "_x002E_");
else else
{ {
pg_wchar u = sqlchar_to_unicode(p); pg_wchar u = sqlchar_to_unicode(p);
...@@ -2438,9 +2438,9 @@ xmldata_root_element_start(StringInfo result, const char *eltname, ...@@ -2438,9 +2438,9 @@ xmldata_root_element_start(StringInfo result, const char *eltname,
if (strlen(targetns) > 0) if (strlen(targetns) > 0)
appendStringInfo(result, " xsi:schemaLocation=\"%s #\"", targetns); appendStringInfo(result, " xsi:schemaLocation=\"%s #\"", targetns);
else 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) ...@@ -2945,7 +2945,7 @@ map_multipart_sql_identifier_to_xml_name(char *a, char *b, char *c, char *d)
initStringInfo(&result); initStringInfo(&result);
if (a) if (a)
appendStringInfo(&result, "%s", appendStringInfoString(&result,
map_sql_identifier_to_xml_name(a, true, true)); map_sql_identifier_to_xml_name(a, true, true));
if (b) if (b)
appendStringInfo(&result, ".%s", appendStringInfo(&result, ".%s",
...@@ -3212,71 +3212,71 @@ map_sql_type_to_xml_name(Oid typeoid, int typmod) ...@@ -3212,71 +3212,71 @@ map_sql_type_to_xml_name(Oid typeoid, int typmod)
{ {
case BPCHAROID: case BPCHAROID:
if (typmod == -1) if (typmod == -1)
appendStringInfo(&result, "CHAR"); appendStringInfoString(&result, "CHAR");
else else
appendStringInfo(&result, "CHAR_%d", typmod - VARHDRSZ); appendStringInfo(&result, "CHAR_%d", typmod - VARHDRSZ);
break; break;
case VARCHAROID: case VARCHAROID:
if (typmod == -1) if (typmod == -1)
appendStringInfo(&result, "VARCHAR"); appendStringInfoString(&result, "VARCHAR");
else else
appendStringInfo(&result, "VARCHAR_%d", typmod - VARHDRSZ); appendStringInfo(&result, "VARCHAR_%d", typmod - VARHDRSZ);
break; break;
case NUMERICOID: case NUMERICOID:
if (typmod == -1) if (typmod == -1)
appendStringInfo(&result, "NUMERIC"); appendStringInfoString(&result, "NUMERIC");
else else
appendStringInfo(&result, "NUMERIC_%d_%d", appendStringInfo(&result, "NUMERIC_%d_%d",
((typmod - VARHDRSZ) >> 16) & 0xffff, ((typmod - VARHDRSZ) >> 16) & 0xffff,
(typmod - VARHDRSZ) & 0xffff); (typmod - VARHDRSZ) & 0xffff);
break; break;
case INT4OID: case INT4OID:
appendStringInfo(&result, "INTEGER"); appendStringInfoString(&result, "INTEGER");
break; break;
case INT2OID: case INT2OID:
appendStringInfo(&result, "SMALLINT"); appendStringInfoString(&result, "SMALLINT");
break; break;
case INT8OID: case INT8OID:
appendStringInfo(&result, "BIGINT"); appendStringInfoString(&result, "BIGINT");
break; break;
case FLOAT4OID: case FLOAT4OID:
appendStringInfo(&result, "REAL"); appendStringInfoString(&result, "REAL");
break; break;
case FLOAT8OID: case FLOAT8OID:
appendStringInfo(&result, "DOUBLE"); appendStringInfoString(&result, "DOUBLE");
break; break;
case BOOLOID: case BOOLOID:
appendStringInfo(&result, "BOOLEAN"); appendStringInfoString(&result, "BOOLEAN");
break; break;
case TIMEOID: case TIMEOID:
if (typmod == -1) if (typmod == -1)
appendStringInfo(&result, "TIME"); appendStringInfoString(&result, "TIME");
else else
appendStringInfo(&result, "TIME_%d", typmod); appendStringInfo(&result, "TIME_%d", typmod);
break; break;
case TIMETZOID: case TIMETZOID:
if (typmod == -1) if (typmod == -1)
appendStringInfo(&result, "TIME_WTZ"); appendStringInfoString(&result, "TIME_WTZ");
else else
appendStringInfo(&result, "TIME_WTZ_%d", typmod); appendStringInfo(&result, "TIME_WTZ_%d", typmod);
break; break;
case TIMESTAMPOID: case TIMESTAMPOID:
if (typmod == -1) if (typmod == -1)
appendStringInfo(&result, "TIMESTAMP"); appendStringInfoString(&result, "TIMESTAMP");
else else
appendStringInfo(&result, "TIMESTAMP_%d", typmod); appendStringInfo(&result, "TIMESTAMP_%d", typmod);
break; break;
case TIMESTAMPTZOID: case TIMESTAMPTZOID:
if (typmod == -1) if (typmod == -1)
appendStringInfo(&result, "TIMESTAMP_WTZ"); appendStringInfoString(&result, "TIMESTAMP_WTZ");
else else
appendStringInfo(&result, "TIMESTAMP_WTZ_%d", typmod); appendStringInfo(&result, "TIMESTAMP_WTZ_%d", typmod);
break; break;
case DATEOID: case DATEOID:
appendStringInfo(&result, "DATE"); appendStringInfoString(&result, "DATE");
break; break;
case XMLOID: case XMLOID:
appendStringInfo(&result, "XML"); appendStringInfoString(&result, "XML");
break; break;
default: default:
{ {
...@@ -3370,7 +3370,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod) ...@@ -3370,7 +3370,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
if (typeoid == XMLOID) if (typeoid == XMLOID)
{ {
appendStringInfo(&result, appendStringInfoString(&result,
"<xsd:complexType mixed=\"true\">\n" "<xsd:complexType mixed=\"true\">\n"
" <xsd:sequence>\n" " <xsd:sequence>\n"
" <xsd:any name=\"element\" minOccurs=\"0\" maxOccurs=\"unbounded\" processContents=\"skip\"/>\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) ...@@ -3393,8 +3393,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
appendStringInfo(&result, appendStringInfo(&result,
" <xsd:maxLength value=\"%d\"/>\n", " <xsd:maxLength value=\"%d\"/>\n",
typmod - VARHDRSZ); typmod - VARHDRSZ);
appendStringInfo(&result, appendStringInfoString(&result, " </xsd:restriction>\n");
" </xsd:restriction>\n");
break; break;
case BYTEAOID: case BYTEAOID:
...@@ -3444,17 +3443,17 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod) ...@@ -3444,17 +3443,17 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
break; break;
case FLOAT4OID: case FLOAT4OID:
appendStringInfo(&result, appendStringInfoString(&result,
" <xsd:restriction base=\"xsd:float\"></xsd:restriction>\n"); " <xsd:restriction base=\"xsd:float\"></xsd:restriction>\n");
break; break;
case FLOAT8OID: case FLOAT8OID:
appendStringInfo(&result, appendStringInfoString(&result,
" <xsd:restriction base=\"xsd:double\"></xsd:restriction>\n"); " <xsd:restriction base=\"xsd:double\"></xsd:restriction>\n");
break; break;
case BOOLOID: case BOOLOID:
appendStringInfo(&result, appendStringInfoString(&result,
" <xsd:restriction base=\"xsd:boolean\"></xsd:restriction>\n"); " <xsd:restriction base=\"xsd:boolean\"></xsd:restriction>\n");
break; break;
...@@ -3505,7 +3504,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod) ...@@ -3505,7 +3504,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
} }
case DATEOID: case DATEOID:
appendStringInfo(&result, appendStringInfoString(&result,
" <xsd:restriction base=\"xsd:date\">\n" " <xsd:restriction base=\"xsd:date\">\n"
" <xsd:pattern value=\"\\p{Nd}{4}-\\p{Nd}{2}-\\p{Nd}{2}\"/>\n" " <xsd:pattern value=\"\\p{Nd}{4}-\\p{Nd}{2}-\\p{Nd}{2}\"/>\n"
" </xsd:restriction>\n"); " </xsd:restriction>\n");
...@@ -3525,8 +3524,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod) ...@@ -3525,8 +3524,7 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
} }
break; break;
} }
appendStringInfo(&result, appendStringInfoString(&result, "</xsd:simpleType>\n");
"</xsd:simpleType>\n");
} }
return result.data; return result.data;
......
...@@ -372,7 +372,7 @@ incompatible_module_error(const char *libname, ...@@ -372,7 +372,7 @@ incompatible_module_error(const char *libname,
} }
if (details.len == 0) if (details.len == 0)
appendStringInfo(&details, appendStringInfoString(&details,
_("Magic block has unexpected length or padding difference.")); _("Magic block has unexpected length or padding difference."));
ereport(ERROR, ereport(ERROR,
......
...@@ -6187,7 +6187,7 @@ flatten_set_variable_args(const char *name, List *args) ...@@ -6187,7 +6187,7 @@ flatten_set_variable_args(const char *name, List *args)
A_Const *con; A_Const *con;
if (l != list_head(args)) if (l != list_head(args))
appendStringInfo(&buf, ", "); appendStringInfoString(&buf, ", ");
if (IsA(arg, TypeCast)) if (IsA(arg, TypeCast))
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment