/* Append HAVING clause */
if (remote_conds)
{
- appendStringInfo(buf, " HAVING ");
+ appendStringInfoString(buf, " HAVING ");
appendConditions(remote_conds, &context);
}
}
/* Construct WHERE clause */
if (quals != NIL)
{
- appendStringInfo(buf, " WHERE ");
+ appendStringInfoString(buf, " WHERE ");
appendConditions(quals, context);
}
}
context.root = root;
context.params_list = params_list;
- appendStringInfo(buf, "(");
+ appendStringInfoChar(buf, '(');
appendConditions(fpinfo->joinclauses, &context);
- appendStringInfo(buf, ")");
+ appendStringInfoChar(buf, ')');
}
else
appendStringInfoString(buf, "(TRUE)");
/* End the FROM clause entry. */
- appendStringInfo(buf, ")");
+ appendStringInfoChar(buf, ')');
}
else
{
if (remote_conds)
{
- appendStringInfo(buf, " WHERE ");
+ appendStringInfoString(buf, " WHERE ");
appendConditions(remote_conds, &context);
}
if (remote_conds)
{
- appendStringInfo(buf, " WHERE ");
+ appendStringInfoString(buf, " WHERE ");
appendConditions(remote_conds, &context);
}
{
appendStringInfoString(buf, "CASE WHEN (");
ADD_REL_QUALIFIER(buf, varno);
- appendStringInfo(buf, "*)::text IS NOT NULL THEN ");
+ appendStringInfoString(buf, "*)::text IS NOT NULL THEN ");
}
appendStringInfoString(buf, "ROW(");
deparseTargetList(buf, root, varno, rel, false, attrs_used, qualify_col,
&retrieved_attrs);
- appendStringInfoString(buf, ")");
+ appendStringInfoChar(buf, ')');
/* Complete the CASE WHEN statement started above. */
if (qualify_col)
- appendStringInfo(buf, " END");
+ appendStringInfoString(buf, " END");
heap_close(rel, NoLock);
bms_free(attrs_used);
appendStringInfoChar(buf, '(');
/* Add DISTINCT */
- appendStringInfo(buf, "%s", (node->aggdistinct != NIL) ? "DISTINCT " : "");
+ appendStringInfoString(buf, (node->aggdistinct != NIL) ? "DISTINCT " : "");
if (AGGKIND_IS_ORDERED_SET(node->aggkind))
{
if (!query->groupClause)
return;
- appendStringInfo(buf, " GROUP BY ");
+ appendStringInfoString(buf, " GROUP BY ");
/*
* Queries with grouping sets are not pushed down, so we don't expect
/* Make sure any constants in the exprs are printed portably */
nestlevel = set_transmission_modes();
- appendStringInfo(buf, " ORDER BY");
+ appendStringInfoString(buf, " ORDER BY");
foreach(lcell, pathkeys)
{
PathKey *pathkey = lfirst(lcell);
/* Always print the function name */
proname = NameStr(procform->proname);
- appendStringInfo(buf, "%s", quote_identifier(proname));
+ appendStringInfoString(buf, quote_identifier(proname));
ReleaseSysCache(proctup);
}
else
{
/* Always parenthesize the expression. */
- appendStringInfoString(buf, "(");
+ appendStringInfoChar(buf, '(');
deparseExpr(expr, context);
- appendStringInfoString(buf, ")");
+ appendStringInfoChar(buf, ')');
}
return (Node *) expr;
Assert(list_length(publications) > 0);
initStringInfo(&cmd);
- appendStringInfo(&cmd, "SELECT DISTINCT t.schemaname, t.tablename\n"
- " FROM pg_catalog.pg_publication_tables t\n"
- " WHERE t.pubname IN (");
+ appendStringInfoString(&cmd, "SELECT DISTINCT t.schemaname, t.tablename\n"
+ " FROM pg_catalog.pg_publication_tables t\n"
+ " WHERE t.pubname IN (");
first = true;
foreach(lc, publications)
{
else
appendStringInfoString(&cmd, ", ");
- appendStringInfo(&cmd, "%s", quote_literal_cstr(pubname));
+ appendStringInfoString(&cmd, quote_literal_cstr(pubname));
}
- appendStringInfoString(&cmd, ")");
+ appendStringInfoChar(&cmd, ')');
res = walrcv_exec(wrconn, cmd.data, 2, tableRow);
pfree(cmd.data);
/* Write a character-string (possibly NULL) field */
#define WRITE_STRING_FIELD(fldname) \
- (appendStringInfo(str, " :" CppAsString(fldname) " "), \
+ (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
outToken(str, node->fldname))
/* Write a parse location field (actually same as INT case) */
/* Write a Node field */
#define WRITE_NODE_FIELD(fldname) \
- (appendStringInfo(str, " :" CppAsString(fldname) " "), \
+ (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
outNode(str, node->fldname))
/* Write a bitmapset field */
#define WRITE_BITMAPSET_FIELD(fldname) \
- (appendStringInfo(str, " :" CppAsString(fldname) " "), \
+ (appendStringInfoString(str, " :" CppAsString(fldname) " "), \
outBitmapset(str, node->fldname))
options->slotname);
if (options->logical)
- appendStringInfo(&cmd, " LOGICAL");
+ appendStringInfoString(&cmd, " LOGICAL");
appendStringInfo(&cmd, " %X/%X",
(uint32) (options->startpoint >> 32),
appendStringInfo(&cmd, "CREATE_REPLICATION_SLOT \"%s\"", slotname);
if (temporary)
- appendStringInfo(&cmd, " TEMPORARY");
+ appendStringInfoString(&cmd, " TEMPORARY");
if (conn->logical)
{
- appendStringInfo(&cmd, " LOGICAL pgoutput");
+ appendStringInfoString(&cmd, " LOGICAL pgoutput");
switch (snapshot_action)
{
case CRS_EXPORT_SNAPSHOT:
- appendStringInfo(&cmd, " EXPORT_SNAPSHOT");
+ appendStringInfoString(&cmd, " EXPORT_SNAPSHOT");
break;
case CRS_NOEXPORT_SNAPSHOT:
- appendStringInfo(&cmd, " NOEXPORT_SNAPSHOT");
+ appendStringInfoString(&cmd, " NOEXPORT_SNAPSHOT");
break;
case CRS_USE_SNAPSHOT:
- appendStringInfo(&cmd, " USE_SNAPSHOT");
+ appendStringInfoString(&cmd, " USE_SNAPSHOT");
break;
}
}
{
case PARTITION_STRATEGY_LIST:
if (!attrsOnly)
- appendStringInfo(&buf, "LIST");
+ appendStringInfoString(&buf, "LIST");
break;
case PARTITION_STRATEGY_RANGE:
if (!attrsOnly)
- appendStringInfo(&buf, "RANGE");
+ appendStringInfoString(&buf, "RANGE");
break;
default:
elog(ERROR, "unexpected partition strategy: %d",
}
if (!attrsOnly)
- appendStringInfo(&buf, " (");
+ appendStringInfoString(&buf, " (");
sep = "";
for (keyno = 0; keyno < form->partnatts; keyno++)
{
||IsA(expr, WindowFunc));
if (need_paren)
- appendStringInfoString(context->buf, "(");
+ appendStringInfoChar(context->buf, '(');
get_rule_expr(expr, context, true);
if (need_paren)
- appendStringInfoString(context->buf, ")");
+ appendStringInfoChar(context->buf, ')');
}
return expr;
case GROUPING_SET_SIMPLE:
{
if (!omit_parens || list_length(gset->content) != 1)
- appendStringInfoString(buf, "(");
+ appendStringInfoChar(buf, '(');
foreach(l, gset->content)
{
}
if (!omit_parens || list_length(gset->content) != 1)
- appendStringInfoString(buf, ")");
+ appendStringInfoChar(buf, ')');
}
return;
sep = ", ";
}
- appendStringInfoString(buf, ")");
+ appendStringInfoChar(buf, ')');
}
/*
sep = ", ";
}
- appendStringInfoString(buf, ")");
+ appendStringInfoChar(buf, ')');
break;
case PARTITION_STRATEGY_RANGE:
}
sep = ", ";
}
- appendStringInfoString(buf, ")");
+ appendStringInfoChar(buf, ')');
return buf->data;
}
case BPCHAROID:
case VARCHAROID:
case TEXTOID:
- appendStringInfo(&result,
- " <xsd:restriction base=\"xsd:string\">\n");
+ appendStringInfoString(&result,
+ " <xsd:restriction base=\"xsd:string\">\n");
if (typmod != -1)
appendStringInfo(&result,
" <xsd:maxLength value=\"%d\"/>\n",
recycle = relptr_access(base, fpm->btree_recycle);
if (recycle != NULL)
{
- appendStringInfo(&buf, "btree recycle:");
+ appendStringInfoString(&buf, "btree recycle:");
FreePageManagerDumpSpans(fpm, recycle, 1, &buf);
}
continue;
if (!dumped_any_freelist)
{
- appendStringInfo(&buf, "freelists:\n");
+ appendStringInfoString(&buf, "freelists:\n");
dumped_any_freelist = true;
}
appendStringInfo(&buf, " %zu:", f + 1);
btp->u.leaf_key[index].first_page,
btp->u.leaf_key[index].npages);
}
- appendStringInfo(buf, "\n");
+ appendStringInfoChar(buf, '\n');
if (btp->hdr.magic == FREE_PAGE_INTERNAL_MAGIC)
{
span = relptr_access(base, span->next);
}
- appendStringInfo(buf, "\n");
+ appendStringInfoChar(buf, '\n');
}
/*
if (tbinfo->ispartition && !dopt->binary_upgrade)
{
- appendPQExpBufferStr(q, "\n");
+ appendPQExpBufferChar(q, '\n');
appendPQExpBufferStr(q, tbinfo->partbound);
}
appendPQExpBuffer(delcmd, "CREATE OR REPLACE VIEW %s.",
fmtId(tbinfo->dobj.namespace->dobj.name));
- appendPQExpBuffer(delcmd, "%s",
- fmtId(tbinfo->dobj.name));
+ appendPQExpBufferStr(delcmd, fmtId(tbinfo->dobj.name));
result = createDummyViewAsClause(fout, tbinfo);
appendPQExpBuffer(delcmd, " AS\n%s;\n", result->data);
destroyPQExpBuffer(result);
appendStringLiteralConn(buf, dbname, conn);
if (server_version >= 90000)
- appendPQExpBuffer(buf, ")");
+ appendPQExpBufferChar(buf, ')');
res = executeQuery(conn, buf->data);
if (PQntuples(res) == 1 &&
psql_error("could not parse reloptions array\n");
result = false;
}
- appendPQExpBufferStr(buf, ")");
+ appendPQExpBufferChar(buf, ')');
}
/* View definition from pg_get_viewdef (a SELECT query) */
appendPQExpBufferStr(msg, fld);
else
appendPQExpBufferStr(msg, "(not available)");
- appendPQExpBufferStr(msg, "\n");
+ appendPQExpBufferChar(msg, '\n');
psql_error("%s", msg->data);
if (strcmp(PQgetvalue(res, i, 7), "") != 0)
{
if (buf.len > 0)
- appendPQExpBufferStr(&buf, "\n");
+ appendPQExpBufferChar(&buf, '\n');
appendPQExpBufferStr(&buf, _("Password valid until "));
appendPQExpBufferStr(&buf, PQgetvalue(res, i, 7));
}
if (cell->next)
appendPQExpBuffer(&sql, "%s,", fmtId(cell->val));
else
- appendPQExpBuffer(&sql, "%s", fmtId(cell->val));
+ appendPQExpBufferStr(&sql, fmtId(cell->val));
}
}
appendPQExpBufferChar(&sql, ';');
if (prevchar != ',')
break;
++p; /* advance past comma separator */
- appendPQExpBufferStr(&hostbuf, ",");
- appendPQExpBufferStr(&portbuf, ",");
+ appendPQExpBufferChar(&hostbuf, ',');
+ appendPQExpBufferChar(&portbuf, ',');
}
/* Save final values for host and port. */