mirror of
https://github.com/postgres/postgres.git
synced 2025-07-02 09:02:37 +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:
@ -1656,11 +1656,11 @@ pg_get_partkeydef_worker(Oid relid, int prettyFlags,
|
||||
{
|
||||
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",
|
||||
@ -1668,7 +1668,7 @@ pg_get_partkeydef_worker(Oid relid, int prettyFlags,
|
||||
}
|
||||
|
||||
if (!attrsOnly)
|
||||
appendStringInfo(&buf, " (");
|
||||
appendStringInfoString(&buf, " (");
|
||||
sep = "";
|
||||
for (keyno = 0; keyno < form->partnatts; keyno++)
|
||||
{
|
||||
@ -5635,10 +5635,10 @@ get_rule_sortgroupclause(Index ref, List *tlist, bool force_colno,
|
||||
||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;
|
||||
@ -5665,7 +5665,7 @@ get_rule_groupingset(GroupingSet *gset, List *targetlist,
|
||||
case GROUPING_SET_SIMPLE:
|
||||
{
|
||||
if (!omit_parens || list_length(gset->content) != 1)
|
||||
appendStringInfoString(buf, "(");
|
||||
appendStringInfoChar(buf, '(');
|
||||
|
||||
foreach(l, gset->content)
|
||||
{
|
||||
@ -5678,7 +5678,7 @@ get_rule_groupingset(GroupingSet *gset, List *targetlist,
|
||||
}
|
||||
|
||||
if (!omit_parens || list_length(gset->content) != 1)
|
||||
appendStringInfoString(buf, ")");
|
||||
appendStringInfoChar(buf, ')');
|
||||
}
|
||||
return;
|
||||
|
||||
@ -5701,7 +5701,7 @@ get_rule_groupingset(GroupingSet *gset, List *targetlist,
|
||||
sep = ", ";
|
||||
}
|
||||
|
||||
appendStringInfoString(buf, ")");
|
||||
appendStringInfoChar(buf, ')');
|
||||
}
|
||||
|
||||
/*
|
||||
@ -8713,7 +8713,7 @@ get_rule_expr(Node *node, deparse_context *context,
|
||||
sep = ", ";
|
||||
}
|
||||
|
||||
appendStringInfoString(buf, ")");
|
||||
appendStringInfoChar(buf, ')');
|
||||
break;
|
||||
|
||||
case PARTITION_STRATEGY_RANGE:
|
||||
@ -10941,7 +10941,7 @@ get_range_partbound_string(List *bound_datums)
|
||||
}
|
||||
sep = ", ";
|
||||
}
|
||||
appendStringInfoString(buf, ")");
|
||||
appendStringInfoChar(buf, ')');
|
||||
|
||||
return buf->data;
|
||||
}
|
||||
|
Reference in New Issue
Block a user