mirror of
https://github.com/postgres/postgres.git
synced 2025-04-27 22:56:53 +03:00
Fix up some misusage of appendStringInfo() and friends
Change to appendStringInfoChar() or appendStringInfoString() where those can be used. Author: David Rowley <david.rowley@2ndquadrant.com> Reviewed-by: Ashutosh Bapat <ashutosh.bapat@enterprisedb.com>
This commit is contained in:
parent
4d4c891715
commit
77d05706be
@ -973,7 +973,7 @@ deparseSelectStmtForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *rel,
|
|||||||
/* Append HAVING clause */
|
/* Append HAVING clause */
|
||||||
if (remote_conds)
|
if (remote_conds)
|
||||||
{
|
{
|
||||||
appendStringInfo(buf, " HAVING ");
|
appendStringInfoString(buf, " HAVING ");
|
||||||
appendConditions(remote_conds, &context);
|
appendConditions(remote_conds, &context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1076,7 +1076,7 @@ deparseFromExpr(List *quals, deparse_expr_cxt *context)
|
|||||||
/* Construct WHERE clause */
|
/* Construct WHERE clause */
|
||||||
if (quals != NIL)
|
if (quals != NIL)
|
||||||
{
|
{
|
||||||
appendStringInfo(buf, " WHERE ");
|
appendStringInfoString(buf, " WHERE ");
|
||||||
appendConditions(quals, context);
|
appendConditions(quals, context);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1447,15 +1447,15 @@ deparseFromExprForRel(StringInfo buf, PlannerInfo *root, RelOptInfo *foreignrel,
|
|||||||
context.root = root;
|
context.root = root;
|
||||||
context.params_list = params_list;
|
context.params_list = params_list;
|
||||||
|
|
||||||
appendStringInfo(buf, "(");
|
appendStringInfoChar(buf, '(');
|
||||||
appendConditions(fpinfo->joinclauses, &context);
|
appendConditions(fpinfo->joinclauses, &context);
|
||||||
appendStringInfo(buf, ")");
|
appendStringInfoChar(buf, ')');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
appendStringInfoString(buf, "(TRUE)");
|
appendStringInfoString(buf, "(TRUE)");
|
||||||
|
|
||||||
/* End the FROM clause entry. */
|
/* End the FROM clause entry. */
|
||||||
appendStringInfo(buf, ")");
|
appendStringInfoChar(buf, ')');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -1702,7 +1702,7 @@ deparseDirectUpdateSql(StringInfo buf, PlannerInfo *root,
|
|||||||
|
|
||||||
if (remote_conds)
|
if (remote_conds)
|
||||||
{
|
{
|
||||||
appendStringInfo(buf, " WHERE ");
|
appendStringInfoString(buf, " WHERE ");
|
||||||
appendConditions(remote_conds, &context);
|
appendConditions(remote_conds, &context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1762,7 +1762,7 @@ deparseDirectDeleteSql(StringInfo buf, PlannerInfo *root,
|
|||||||
|
|
||||||
if (remote_conds)
|
if (remote_conds)
|
||||||
{
|
{
|
||||||
appendStringInfo(buf, " WHERE ");
|
appendStringInfoString(buf, " WHERE ");
|
||||||
appendConditions(remote_conds, &context);
|
appendConditions(remote_conds, &context);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1978,17 +1978,17 @@ deparseColumnRef(StringInfo buf, int varno, int varattno, PlannerInfo *root,
|
|||||||
{
|
{
|
||||||
appendStringInfoString(buf, "CASE WHEN (");
|
appendStringInfoString(buf, "CASE WHEN (");
|
||||||
ADD_REL_QUALIFIER(buf, varno);
|
ADD_REL_QUALIFIER(buf, varno);
|
||||||
appendStringInfo(buf, "*)::text IS NOT NULL THEN ");
|
appendStringInfoString(buf, "*)::text IS NOT NULL THEN ");
|
||||||
}
|
}
|
||||||
|
|
||||||
appendStringInfoString(buf, "ROW(");
|
appendStringInfoString(buf, "ROW(");
|
||||||
deparseTargetList(buf, root, varno, rel, false, attrs_used, qualify_col,
|
deparseTargetList(buf, root, varno, rel, false, attrs_used, qualify_col,
|
||||||
&retrieved_attrs);
|
&retrieved_attrs);
|
||||||
appendStringInfoString(buf, ")");
|
appendStringInfoChar(buf, ')');
|
||||||
|
|
||||||
/* Complete the CASE WHEN statement started above. */
|
/* Complete the CASE WHEN statement started above. */
|
||||||
if (qualify_col)
|
if (qualify_col)
|
||||||
appendStringInfo(buf, " END");
|
appendStringInfoString(buf, " END");
|
||||||
|
|
||||||
heap_close(rel, NoLock);
|
heap_close(rel, NoLock);
|
||||||
bms_free(attrs_used);
|
bms_free(attrs_used);
|
||||||
@ -2759,7 +2759,7 @@ deparseAggref(Aggref *node, deparse_expr_cxt *context)
|
|||||||
appendStringInfoChar(buf, '(');
|
appendStringInfoChar(buf, '(');
|
||||||
|
|
||||||
/* Add DISTINCT */
|
/* Add DISTINCT */
|
||||||
appendStringInfo(buf, "%s", (node->aggdistinct != NIL) ? "DISTINCT " : "");
|
appendStringInfoString(buf, (node->aggdistinct != NIL) ? "DISTINCT " : "");
|
||||||
|
|
||||||
if (AGGKIND_IS_ORDERED_SET(node->aggkind))
|
if (AGGKIND_IS_ORDERED_SET(node->aggkind))
|
||||||
{
|
{
|
||||||
@ -2944,7 +2944,7 @@ appendGroupByClause(List *tlist, deparse_expr_cxt *context)
|
|||||||
if (!query->groupClause)
|
if (!query->groupClause)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
appendStringInfo(buf, " GROUP BY ");
|
appendStringInfoString(buf, " GROUP BY ");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Queries with grouping sets are not pushed down, so we don't expect
|
* Queries with grouping sets are not pushed down, so we don't expect
|
||||||
@ -2981,7 +2981,7 @@ appendOrderByClause(List *pathkeys, deparse_expr_cxt *context)
|
|||||||
/* Make sure any constants in the exprs are printed portably */
|
/* Make sure any constants in the exprs are printed portably */
|
||||||
nestlevel = set_transmission_modes();
|
nestlevel = set_transmission_modes();
|
||||||
|
|
||||||
appendStringInfo(buf, " ORDER BY");
|
appendStringInfoString(buf, " ORDER BY");
|
||||||
foreach(lcell, pathkeys)
|
foreach(lcell, pathkeys)
|
||||||
{
|
{
|
||||||
PathKey *pathkey = lfirst(lcell);
|
PathKey *pathkey = lfirst(lcell);
|
||||||
@ -3035,7 +3035,7 @@ appendFunctionName(Oid funcid, deparse_expr_cxt *context)
|
|||||||
|
|
||||||
/* Always print the function name */
|
/* Always print the function name */
|
||||||
proname = NameStr(procform->proname);
|
proname = NameStr(procform->proname);
|
||||||
appendStringInfo(buf, "%s", quote_identifier(proname));
|
appendStringInfoString(buf, quote_identifier(proname));
|
||||||
|
|
||||||
ReleaseSysCache(proctup);
|
ReleaseSysCache(proctup);
|
||||||
}
|
}
|
||||||
@ -3070,9 +3070,9 @@ deparseSortGroupClause(Index ref, List *tlist, deparse_expr_cxt *context)
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Always parenthesize the expression. */
|
/* Always parenthesize the expression. */
|
||||||
appendStringInfoString(buf, "(");
|
appendStringInfoChar(buf, '(');
|
||||||
deparseExpr(expr, context);
|
deparseExpr(expr, context);
|
||||||
appendStringInfoString(buf, ")");
|
appendStringInfoChar(buf, ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
return (Node *) expr;
|
return (Node *) expr;
|
||||||
|
@ -1117,9 +1117,9 @@ fetch_table_list(WalReceiverConn *wrconn, List *publications)
|
|||||||
Assert(list_length(publications) > 0);
|
Assert(list_length(publications) > 0);
|
||||||
|
|
||||||
initStringInfo(&cmd);
|
initStringInfo(&cmd);
|
||||||
appendStringInfo(&cmd, "SELECT DISTINCT t.schemaname, t.tablename\n"
|
appendStringInfoString(&cmd, "SELECT DISTINCT t.schemaname, t.tablename\n"
|
||||||
" FROM pg_catalog.pg_publication_tables t\n"
|
" FROM pg_catalog.pg_publication_tables t\n"
|
||||||
" WHERE t.pubname IN (");
|
" WHERE t.pubname IN (");
|
||||||
first = true;
|
first = true;
|
||||||
foreach(lc, publications)
|
foreach(lc, publications)
|
||||||
{
|
{
|
||||||
@ -1130,9 +1130,9 @@ fetch_table_list(WalReceiverConn *wrconn, List *publications)
|
|||||||
else
|
else
|
||||||
appendStringInfoString(&cmd, ", ");
|
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);
|
res = walrcv_exec(wrconn, cmd.data, 2, tableRow);
|
||||||
pfree(cmd.data);
|
pfree(cmd.data);
|
||||||
|
@ -83,7 +83,7 @@ static void outChar(StringInfo str, char c);
|
|||||||
|
|
||||||
/* Write a character-string (possibly NULL) field */
|
/* Write a character-string (possibly NULL) field */
|
||||||
#define WRITE_STRING_FIELD(fldname) \
|
#define WRITE_STRING_FIELD(fldname) \
|
||||||
(appendStringInfo(str, " :" CppAsString(fldname) " "), \
|
(appendStringInfoString(str, " :" CppAsString(fldname) " "), \
|
||||||
outToken(str, node->fldname))
|
outToken(str, node->fldname))
|
||||||
|
|
||||||
/* Write a parse location field (actually same as INT case) */
|
/* Write a parse location field (actually same as INT case) */
|
||||||
@ -92,12 +92,12 @@ static void outChar(StringInfo str, char c);
|
|||||||
|
|
||||||
/* Write a Node field */
|
/* Write a Node field */
|
||||||
#define WRITE_NODE_FIELD(fldname) \
|
#define WRITE_NODE_FIELD(fldname) \
|
||||||
(appendStringInfo(str, " :" CppAsString(fldname) " "), \
|
(appendStringInfoString(str, " :" CppAsString(fldname) " "), \
|
||||||
outNode(str, node->fldname))
|
outNode(str, node->fldname))
|
||||||
|
|
||||||
/* Write a bitmapset field */
|
/* Write a bitmapset field */
|
||||||
#define WRITE_BITMAPSET_FIELD(fldname) \
|
#define WRITE_BITMAPSET_FIELD(fldname) \
|
||||||
(appendStringInfo(str, " :" CppAsString(fldname) " "), \
|
(appendStringInfoString(str, " :" CppAsString(fldname) " "), \
|
||||||
outBitmapset(str, node->fldname))
|
outBitmapset(str, node->fldname))
|
||||||
|
|
||||||
|
|
||||||
|
@ -355,7 +355,7 @@ libpqrcv_startstreaming(WalReceiverConn *conn,
|
|||||||
options->slotname);
|
options->slotname);
|
||||||
|
|
||||||
if (options->logical)
|
if (options->logical)
|
||||||
appendStringInfo(&cmd, " LOGICAL");
|
appendStringInfoString(&cmd, " LOGICAL");
|
||||||
|
|
||||||
appendStringInfo(&cmd, " %X/%X",
|
appendStringInfo(&cmd, " %X/%X",
|
||||||
(uint32) (options->startpoint >> 32),
|
(uint32) (options->startpoint >> 32),
|
||||||
@ -774,21 +774,21 @@ libpqrcv_create_slot(WalReceiverConn *conn, const char *slotname,
|
|||||||
appendStringInfo(&cmd, "CREATE_REPLICATION_SLOT \"%s\"", slotname);
|
appendStringInfo(&cmd, "CREATE_REPLICATION_SLOT \"%s\"", slotname);
|
||||||
|
|
||||||
if (temporary)
|
if (temporary)
|
||||||
appendStringInfo(&cmd, " TEMPORARY");
|
appendStringInfoString(&cmd, " TEMPORARY");
|
||||||
|
|
||||||
if (conn->logical)
|
if (conn->logical)
|
||||||
{
|
{
|
||||||
appendStringInfo(&cmd, " LOGICAL pgoutput");
|
appendStringInfoString(&cmd, " LOGICAL pgoutput");
|
||||||
switch (snapshot_action)
|
switch (snapshot_action)
|
||||||
{
|
{
|
||||||
case CRS_EXPORT_SNAPSHOT:
|
case CRS_EXPORT_SNAPSHOT:
|
||||||
appendStringInfo(&cmd, " EXPORT_SNAPSHOT");
|
appendStringInfoString(&cmd, " EXPORT_SNAPSHOT");
|
||||||
break;
|
break;
|
||||||
case CRS_NOEXPORT_SNAPSHOT:
|
case CRS_NOEXPORT_SNAPSHOT:
|
||||||
appendStringInfo(&cmd, " NOEXPORT_SNAPSHOT");
|
appendStringInfoString(&cmd, " NOEXPORT_SNAPSHOT");
|
||||||
break;
|
break;
|
||||||
case CRS_USE_SNAPSHOT:
|
case CRS_USE_SNAPSHOT:
|
||||||
appendStringInfo(&cmd, " USE_SNAPSHOT");
|
appendStringInfoString(&cmd, " USE_SNAPSHOT");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1656,11 +1656,11 @@ pg_get_partkeydef_worker(Oid relid, int prettyFlags,
|
|||||||
{
|
{
|
||||||
case PARTITION_STRATEGY_LIST:
|
case PARTITION_STRATEGY_LIST:
|
||||||
if (!attrsOnly)
|
if (!attrsOnly)
|
||||||
appendStringInfo(&buf, "LIST");
|
appendStringInfoString(&buf, "LIST");
|
||||||
break;
|
break;
|
||||||
case PARTITION_STRATEGY_RANGE:
|
case PARTITION_STRATEGY_RANGE:
|
||||||
if (!attrsOnly)
|
if (!attrsOnly)
|
||||||
appendStringInfo(&buf, "RANGE");
|
appendStringInfoString(&buf, "RANGE");
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
elog(ERROR, "unexpected partition strategy: %d",
|
elog(ERROR, "unexpected partition strategy: %d",
|
||||||
@ -1668,7 +1668,7 @@ pg_get_partkeydef_worker(Oid relid, int prettyFlags,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!attrsOnly)
|
if (!attrsOnly)
|
||||||
appendStringInfo(&buf, " (");
|
appendStringInfoString(&buf, " (");
|
||||||
sep = "";
|
sep = "";
|
||||||
for (keyno = 0; keyno < form->partnatts; keyno++)
|
for (keyno = 0; keyno < form->partnatts; keyno++)
|
||||||
{
|
{
|
||||||
@ -5635,10 +5635,10 @@ get_rule_sortgroupclause(Index ref, List *tlist, bool force_colno,
|
|||||||
||IsA(expr, WindowFunc));
|
||IsA(expr, WindowFunc));
|
||||||
|
|
||||||
if (need_paren)
|
if (need_paren)
|
||||||
appendStringInfoString(context->buf, "(");
|
appendStringInfoChar(context->buf, '(');
|
||||||
get_rule_expr(expr, context, true);
|
get_rule_expr(expr, context, true);
|
||||||
if (need_paren)
|
if (need_paren)
|
||||||
appendStringInfoString(context->buf, ")");
|
appendStringInfoChar(context->buf, ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
return expr;
|
return expr;
|
||||||
@ -5665,7 +5665,7 @@ get_rule_groupingset(GroupingSet *gset, List *targetlist,
|
|||||||
case GROUPING_SET_SIMPLE:
|
case GROUPING_SET_SIMPLE:
|
||||||
{
|
{
|
||||||
if (!omit_parens || list_length(gset->content) != 1)
|
if (!omit_parens || list_length(gset->content) != 1)
|
||||||
appendStringInfoString(buf, "(");
|
appendStringInfoChar(buf, '(');
|
||||||
|
|
||||||
foreach(l, gset->content)
|
foreach(l, gset->content)
|
||||||
{
|
{
|
||||||
@ -5678,7 +5678,7 @@ get_rule_groupingset(GroupingSet *gset, List *targetlist,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!omit_parens || list_length(gset->content) != 1)
|
if (!omit_parens || list_length(gset->content) != 1)
|
||||||
appendStringInfoString(buf, ")");
|
appendStringInfoChar(buf, ')');
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -5701,7 +5701,7 @@ get_rule_groupingset(GroupingSet *gset, List *targetlist,
|
|||||||
sep = ", ";
|
sep = ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
appendStringInfoString(buf, ")");
|
appendStringInfoChar(buf, ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -8713,7 +8713,7 @@ get_rule_expr(Node *node, deparse_context *context,
|
|||||||
sep = ", ";
|
sep = ", ";
|
||||||
}
|
}
|
||||||
|
|
||||||
appendStringInfoString(buf, ")");
|
appendStringInfoChar(buf, ')');
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case PARTITION_STRATEGY_RANGE:
|
case PARTITION_STRATEGY_RANGE:
|
||||||
@ -10941,7 +10941,7 @@ get_range_partbound_string(List *bound_datums)
|
|||||||
}
|
}
|
||||||
sep = ", ";
|
sep = ", ";
|
||||||
}
|
}
|
||||||
appendStringInfoString(buf, ")");
|
appendStringInfoChar(buf, ')');
|
||||||
|
|
||||||
return buf->data;
|
return buf->data;
|
||||||
}
|
}
|
||||||
|
@ -3458,8 +3458,8 @@ map_sql_type_to_xmlschema_type(Oid typeoid, int typmod)
|
|||||||
case BPCHAROID:
|
case BPCHAROID:
|
||||||
case VARCHAROID:
|
case VARCHAROID:
|
||||||
case TEXTOID:
|
case TEXTOID:
|
||||||
appendStringInfo(&result,
|
appendStringInfoString(&result,
|
||||||
" <xsd:restriction base=\"xsd:string\">\n");
|
" <xsd:restriction base=\"xsd:string\">\n");
|
||||||
if (typmod != -1)
|
if (typmod != -1)
|
||||||
appendStringInfo(&result,
|
appendStringInfo(&result,
|
||||||
" <xsd:maxLength value=\"%d\"/>\n",
|
" <xsd:maxLength value=\"%d\"/>\n",
|
||||||
|
@ -455,7 +455,7 @@ FreePageManagerDump(FreePageManager *fpm)
|
|||||||
recycle = relptr_access(base, fpm->btree_recycle);
|
recycle = relptr_access(base, fpm->btree_recycle);
|
||||||
if (recycle != NULL)
|
if (recycle != NULL)
|
||||||
{
|
{
|
||||||
appendStringInfo(&buf, "btree recycle:");
|
appendStringInfoString(&buf, "btree recycle:");
|
||||||
FreePageManagerDumpSpans(fpm, recycle, 1, &buf);
|
FreePageManagerDumpSpans(fpm, recycle, 1, &buf);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -468,7 +468,7 @@ FreePageManagerDump(FreePageManager *fpm)
|
|||||||
continue;
|
continue;
|
||||||
if (!dumped_any_freelist)
|
if (!dumped_any_freelist)
|
||||||
{
|
{
|
||||||
appendStringInfo(&buf, "freelists:\n");
|
appendStringInfoString(&buf, "freelists:\n");
|
||||||
dumped_any_freelist = true;
|
dumped_any_freelist = true;
|
||||||
}
|
}
|
||||||
appendStringInfo(&buf, " %zu:", f + 1);
|
appendStringInfo(&buf, " %zu:", f + 1);
|
||||||
@ -1275,7 +1275,7 @@ FreePageManagerDumpBtree(FreePageManager *fpm, FreePageBtree *btp,
|
|||||||
btp->u.leaf_key[index].first_page,
|
btp->u.leaf_key[index].first_page,
|
||||||
btp->u.leaf_key[index].npages);
|
btp->u.leaf_key[index].npages);
|
||||||
}
|
}
|
||||||
appendStringInfo(buf, "\n");
|
appendStringInfoChar(buf, '\n');
|
||||||
|
|
||||||
if (btp->hdr.magic == FREE_PAGE_INTERNAL_MAGIC)
|
if (btp->hdr.magic == FREE_PAGE_INTERNAL_MAGIC)
|
||||||
{
|
{
|
||||||
@ -1308,7 +1308,7 @@ FreePageManagerDumpSpans(FreePageManager *fpm, FreePageSpanLeader *span,
|
|||||||
span = relptr_access(base, span->next);
|
span = relptr_access(base, span->next);
|
||||||
}
|
}
|
||||||
|
|
||||||
appendStringInfo(buf, "\n");
|
appendStringInfoChar(buf, '\n');
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -15424,7 +15424,7 @@ dumpTableSchema(Archive *fout, TableInfo *tbinfo)
|
|||||||
|
|
||||||
if (tbinfo->ispartition && !dopt->binary_upgrade)
|
if (tbinfo->ispartition && !dopt->binary_upgrade)
|
||||||
{
|
{
|
||||||
appendPQExpBufferStr(q, "\n");
|
appendPQExpBufferChar(q, '\n');
|
||||||
appendPQExpBufferStr(q, tbinfo->partbound);
|
appendPQExpBufferStr(q, tbinfo->partbound);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -17127,8 +17127,7 @@ dumpRule(Archive *fout, RuleInfo *rinfo)
|
|||||||
|
|
||||||
appendPQExpBuffer(delcmd, "CREATE OR REPLACE VIEW %s.",
|
appendPQExpBuffer(delcmd, "CREATE OR REPLACE VIEW %s.",
|
||||||
fmtId(tbinfo->dobj.namespace->dobj.name));
|
fmtId(tbinfo->dobj.namespace->dobj.name));
|
||||||
appendPQExpBuffer(delcmd, "%s",
|
appendPQExpBufferStr(delcmd, fmtId(tbinfo->dobj.name));
|
||||||
fmtId(tbinfo->dobj.name));
|
|
||||||
result = createDummyViewAsClause(fout, tbinfo);
|
result = createDummyViewAsClause(fout, tbinfo);
|
||||||
appendPQExpBuffer(delcmd, " AS\n%s;\n", result->data);
|
appendPQExpBuffer(delcmd, " AS\n%s;\n", result->data);
|
||||||
destroyPQExpBuffer(result);
|
destroyPQExpBuffer(result);
|
||||||
|
@ -1575,7 +1575,7 @@ dumpDatabaseConfig(PGconn *conn, const char *dbname)
|
|||||||
appendStringLiteralConn(buf, dbname, conn);
|
appendStringLiteralConn(buf, dbname, conn);
|
||||||
|
|
||||||
if (server_version >= 90000)
|
if (server_version >= 90000)
|
||||||
appendPQExpBuffer(buf, ")");
|
appendPQExpBufferChar(buf, ')');
|
||||||
|
|
||||||
res = executeQuery(conn, buf->data);
|
res = executeQuery(conn, buf->data);
|
||||||
if (PQntuples(res) == 1 &&
|
if (PQntuples(res) == 1 &&
|
||||||
|
@ -4676,7 +4676,7 @@ get_create_object_cmd(EditableObjectType obj_type, Oid oid,
|
|||||||
psql_error("could not parse reloptions array\n");
|
psql_error("could not parse reloptions array\n");
|
||||||
result = false;
|
result = false;
|
||||||
}
|
}
|
||||||
appendPQExpBufferStr(buf, ")");
|
appendPQExpBufferChar(buf, ')');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* View definition from pg_get_viewdef (a SELECT query) */
|
/* View definition from pg_get_viewdef (a SELECT query) */
|
||||||
@ -4862,7 +4862,7 @@ minimal_error_message(PGresult *res)
|
|||||||
appendPQExpBufferStr(msg, fld);
|
appendPQExpBufferStr(msg, fld);
|
||||||
else
|
else
|
||||||
appendPQExpBufferStr(msg, "(not available)");
|
appendPQExpBufferStr(msg, "(not available)");
|
||||||
appendPQExpBufferStr(msg, "\n");
|
appendPQExpBufferChar(msg, '\n');
|
||||||
|
|
||||||
psql_error("%s", msg->data);
|
psql_error("%s", msg->data);
|
||||||
|
|
||||||
|
@ -3177,7 +3177,7 @@ describeRoles(const char *pattern, bool verbose, bool showSystem)
|
|||||||
if (strcmp(PQgetvalue(res, i, 7), "") != 0)
|
if (strcmp(PQgetvalue(res, i, 7), "") != 0)
|
||||||
{
|
{
|
||||||
if (buf.len > 0)
|
if (buf.len > 0)
|
||||||
appendPQExpBufferStr(&buf, "\n");
|
appendPQExpBufferChar(&buf, '\n');
|
||||||
appendPQExpBufferStr(&buf, _("Password valid until "));
|
appendPQExpBufferStr(&buf, _("Password valid until "));
|
||||||
appendPQExpBufferStr(&buf, PQgetvalue(res, i, 7));
|
appendPQExpBufferStr(&buf, PQgetvalue(res, i, 7));
|
||||||
}
|
}
|
||||||
|
@ -313,7 +313,7 @@ main(int argc, char *argv[])
|
|||||||
if (cell->next)
|
if (cell->next)
|
||||||
appendPQExpBuffer(&sql, "%s,", fmtId(cell->val));
|
appendPQExpBuffer(&sql, "%s,", fmtId(cell->val));
|
||||||
else
|
else
|
||||||
appendPQExpBuffer(&sql, "%s", fmtId(cell->val));
|
appendPQExpBufferStr(&sql, fmtId(cell->val));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
appendPQExpBufferChar(&sql, ';');
|
appendPQExpBufferChar(&sql, ';');
|
||||||
|
@ -5508,8 +5508,8 @@ conninfo_uri_parse_options(PQconninfoOption *options, const char *uri,
|
|||||||
if (prevchar != ',')
|
if (prevchar != ',')
|
||||||
break;
|
break;
|
||||||
++p; /* advance past comma separator */
|
++p; /* advance past comma separator */
|
||||||
appendPQExpBufferStr(&hostbuf, ",");
|
appendPQExpBufferChar(&hostbuf, ',');
|
||||||
appendPQExpBufferStr(&portbuf, ",");
|
appendPQExpBufferChar(&portbuf, ',');
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Save final values for host and port. */
|
/* Save final values for host and port. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user