aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r--src/backend/utils/adt/ruleutils.c50
1 files changed, 28 insertions, 22 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 5d49f564a2e..f22ecfc5832 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -2331,7 +2331,10 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
if (string)
appendStringInfo(&buf, " ON DELETE %s", string);
- /* Add columns specified to SET NULL or SET DEFAULT if provided. */
+ /*
+ * Add columns specified to SET NULL or SET DEFAULT if
+ * provided.
+ */
val = SysCacheGetAttr(CONSTROID, tup,
Anum_pg_constraint_confdelsetcols, &isnull);
if (!isnull)
@@ -8260,7 +8263,7 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags)
case T_GroupingFunc: /* own parentheses */
case T_WindowFunc: /* own parentheses */
case T_CaseExpr: /* other separators */
- case T_JsonExpr: /* own parentheses */
+ case T_JsonExpr: /* own parentheses */
return true;
default:
return false;
@@ -8456,8 +8459,8 @@ get_json_format(JsonFormat *format, StringInfo buf)
if (format->encoding != JS_ENC_DEFAULT)
{
const char *encoding =
- format->encoding == JS_ENC_UTF16 ? "UTF16" :
- format->encoding == JS_ENC_UTF32 ? "UTF32" : "UTF8";
+ format->encoding == JS_ENC_UTF16 ? "UTF16" :
+ format->encoding == JS_ENC_UTF32 ? "UTF32" : "UTF8";
appendStringInfo(buf, " ENCODING %s", encoding);
}
@@ -8479,7 +8482,7 @@ get_json_returning(JsonReturning *returning, StringInfo buf,
if (!json_format_by_default ||
returning->format->format_type !=
- (returning->typid == JSONBOID ? JS_FORMAT_JSONB : JS_FORMAT_JSON))
+ (returning->typid == JSONBOID ? JS_FORMAT_JSONB : JS_FORMAT_JSON))
get_json_format(returning->format, buf);
}
@@ -9778,7 +9781,8 @@ get_rule_expr(Node *node, deparse_context *context,
if (jexpr->passing_values)
{
- ListCell *lc1, *lc2;
+ ListCell *lc1,
+ *lc2;
bool needcomma = false;
appendStringInfoString(buf, " PASSING ");
@@ -10147,7 +10151,7 @@ get_json_constructor(JsonConstructorExpr *ctor, deparse_context *context,
if (nargs > 0)
{
const char *sep = ctor->type == JSCTOR_JSON_OBJECT &&
- (nargs % 2) != 0 ? " : " : ", ";
+ (nargs % 2) != 0 ? " : " : ", ";
appendStringInfoString(buf, sep);
}
@@ -10251,7 +10255,8 @@ get_agg_expr_helper(Aggref *aggref, deparse_context *context,
if (is_json_objectagg)
{
if (i > 2)
- break; /* skip ABSENT ON NULL and WITH UNIQUE args */
+ break; /* skip ABSENT ON NULL and WITH UNIQUE
+ * args */
appendStringInfoString(buf, " : ");
}
@@ -11160,16 +11165,16 @@ get_json_table_nested_columns(TableFunc *tf, Node *node,
}
else
{
- JsonTableParent *n = castNode(JsonTableParent, node);
+ JsonTableParent *n = castNode(JsonTableParent, node);
- if (needcomma)
- appendStringInfoChar(context->buf, ',');
+ if (needcomma)
+ appendStringInfoChar(context->buf, ',');
- appendStringInfoChar(context->buf, ' ');
- appendContextKeyword(context, "NESTED PATH ", 0, 0, 0);
- get_const_expr(n->path, context, -1);
- appendStringInfo(context->buf, " AS %s", quote_identifier(n->name));
- get_json_table_columns(tf, n, context, showimplicit);
+ appendStringInfoChar(context->buf, ' ');
+ appendContextKeyword(context, "NESTED PATH ", 0, 0, 0);
+ get_const_expr(n->path, context, -1);
+ appendStringInfo(context->buf, " AS %s", quote_identifier(n->name));
+ get_json_table_columns(tf, n, context, showimplicit);
}
}
@@ -11199,17 +11204,17 @@ get_json_table_plan(TableFunc *tf, Node *node, deparse_context *context,
}
else
{
- JsonTableParent *n = castNode(JsonTableParent, node);
+ JsonTableParent *n = castNode(JsonTableParent, node);
- appendStringInfoString(context->buf, quote_identifier(n->name));
+ appendStringInfoString(context->buf, quote_identifier(n->name));
- if (n->child)
- {
+ if (n->child)
+ {
appendStringInfoString(context->buf,
n->outerJoin ? " OUTER " : " INNER ");
get_json_table_plan(tf, n->child, context,
IsA(n->child, JsonTableSibling));
- }
+ }
}
if (parenthesize)
@@ -11348,7 +11353,8 @@ get_json_table(TableFunc *tf, deparse_context *context, bool showimplicit)
if (jexpr->passing_values)
{
- ListCell *lc1, *lc2;
+ ListCell *lc1,
+ *lc2;
bool needcomma = false;
appendStringInfoChar(buf, ' ');