diff options
Diffstat (limited to 'contrib')
| -rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 14 | ||||
| -rw-r--r-- | contrib/tcn/tcn.c | 19 |
2 files changed, 17 insertions, 16 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 456b267f70b..06b52c65300 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -2841,7 +2841,7 @@ postgresExplainForeignScan(ForeignScanState *node, ExplainState *es) */ if (list_length(fdw_private) > FdwScanPrivateRelations) { - StringInfo relations; + StringInfoData relations; char *rawrelations; char *ptr; int minrti, @@ -2875,7 +2875,7 @@ postgresExplainForeignScan(ForeignScanState *node, ExplainState *es) rtoffset = bms_next_member(plan->fs_base_relids, -1) - minrti; /* Now we can translate the string */ - relations = makeStringInfo(); + initStringInfo(&relations); ptr = rawrelations; while (*ptr) { @@ -2897,24 +2897,24 @@ postgresExplainForeignScan(ForeignScanState *node, ExplainState *es) char *namespace; namespace = get_namespace_name_or_temp(get_rel_namespace(rte->relid)); - appendStringInfo(relations, "%s.%s", + appendStringInfo(&relations, "%s.%s", quote_identifier(namespace), quote_identifier(relname)); } else - appendStringInfoString(relations, + appendStringInfoString(&relations, quote_identifier(relname)); refname = (char *) list_nth(es->rtable_names, rti - 1); if (refname == NULL) refname = rte->eref->aliasname; if (strcmp(refname, relname) != 0) - appendStringInfo(relations, " %s", + appendStringInfo(&relations, " %s", quote_identifier(refname)); } else - appendStringInfoChar(relations, *ptr++); + appendStringInfoChar(&relations, *ptr++); } - ExplainPropertyText("Relations", relations->data, es); + ExplainPropertyText("Relations", relations.data, es); } /* diff --git a/contrib/tcn/tcn.c b/contrib/tcn/tcn.c index 3158dee0f26..9ca47f17cac 100644 --- a/contrib/tcn/tcn.c +++ b/contrib/tcn/tcn.c @@ -66,12 +66,13 @@ triggered_change_notification(PG_FUNCTION_ARGS) TupleDesc tupdesc; char *channel; char operation; - StringInfo payload = makeStringInfo(); + StringInfoData payload; bool foundPK; List *indexoidlist; ListCell *indexoidscan; + initStringInfo(&payload); /* make sure it's called as a trigger */ if (!CALLED_AS_TRIGGER(fcinfo)) ereport(ERROR, @@ -149,22 +150,22 @@ triggered_change_notification(PG_FUNCTION_ARGS) foundPK = true; - strcpy_quoted(payload, RelationGetRelationName(rel), '"'); - appendStringInfoCharMacro(payload, ','); - appendStringInfoCharMacro(payload, operation); + strcpy_quoted(&payload, RelationGetRelationName(rel), '"'); + appendStringInfoCharMacro(&payload, ','); + appendStringInfoCharMacro(&payload, operation); for (i = 0; i < indnkeyatts; i++) { int colno = index->indkey.values[i]; Form_pg_attribute attr = TupleDescAttr(tupdesc, colno - 1); - appendStringInfoCharMacro(payload, ','); - strcpy_quoted(payload, NameStr(attr->attname), '"'); - appendStringInfoCharMacro(payload, '='); - strcpy_quoted(payload, SPI_getvalue(trigtuple, tupdesc, colno), '\''); + appendStringInfoCharMacro(&payload, ','); + strcpy_quoted(&payload, NameStr(attr->attname), '"'); + appendStringInfoCharMacro(&payload, '='); + strcpy_quoted(&payload, SPI_getvalue(trigtuple, tupdesc, colno), '\''); } - Async_Notify(channel, payload->data); + Async_Notify(channel, payload.data); } ReleaseSysCache(indexTuple); break; |
