mirror of https://github.com/citusdata/citus.git
Ruleutils_17 Add RETURNING support to MERGE.
Relevant PG commit:
c649fa24a42ba89bf5460c7110e4fc8eeca65959
c649fa24a4
m3hm3t/pg17_isolation_test_cmd_from
parent
61b92ee697
commit
c6c1ff2681
|
@ -3874,8 +3874,13 @@ get_merge_query_def(Query *query, deparse_context *context,
|
||||||
appendStringInfoString(buf, "DO NOTHING");
|
appendStringInfoString(buf, "DO NOTHING");
|
||||||
}
|
}
|
||||||
|
|
||||||
/* No RETURNING support in MERGE yet */
|
/* Add RETURNING if present */
|
||||||
Assert(query->returningList == NIL);
|
if (query->returningList)
|
||||||
|
{
|
||||||
|
appendContextKeyword(context, " RETURNING",
|
||||||
|
-PRETTYINDENT_STD, PRETTYINDENT_STD, 1);
|
||||||
|
get_target_list(query->returningList, context, NULL, colNamesVisible);
|
||||||
|
}
|
||||||
|
|
||||||
ereport(DEBUG1, (errmsg("<Deparsed MERGE query: %s>", buf->data)));
|
ereport(DEBUG1, (errmsg("<Deparsed MERGE query: %s>", buf->data)));
|
||||||
}
|
}
|
||||||
|
@ -5033,6 +5038,7 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags)
|
||||||
case T_Aggref:
|
case T_Aggref:
|
||||||
case T_GroupingFunc:
|
case T_GroupingFunc:
|
||||||
case T_WindowFunc:
|
case T_WindowFunc:
|
||||||
|
case T_MergeSupportFunc:
|
||||||
case T_FuncExpr:
|
case T_FuncExpr:
|
||||||
case T_JsonConstructorExpr:
|
case T_JsonConstructorExpr:
|
||||||
/* function-like: name(..) or name[..] */
|
/* function-like: name(..) or name[..] */
|
||||||
|
@ -5384,6 +5390,10 @@ get_rule_expr(Node *node, deparse_context *context,
|
||||||
get_windowfunc_expr((WindowFunc *) node, context);
|
get_windowfunc_expr((WindowFunc *) node, context);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case T_MergeSupportFunc:
|
||||||
|
appendStringInfoString(buf, "MERGE_ACTION()");
|
||||||
|
break;
|
||||||
|
|
||||||
case T_SubscriptingRef:
|
case T_SubscriptingRef:
|
||||||
{
|
{
|
||||||
SubscriptingRef *sbsref = (SubscriptingRef *) node;
|
SubscriptingRef *sbsref = (SubscriptingRef *) node;
|
||||||
|
|
Loading…
Reference in New Issue