mirror of https://github.com/citusdata/citus.git
Add IS JSON predicate to ruleutils_15.c
Relevant PG commit: 33a377608fc29cdd1f6b63be561eab0aee5c81f0naisila/failure_pg15
parent
4415e3ee6e
commit
92b1df09eb
|
@ -4954,6 +4954,7 @@ isSimpleNode(Node *node, Node *parentNode, int prettyFlags)
|
||||||
case T_NullTest:
|
case T_NullTest:
|
||||||
case T_BooleanTest:
|
case T_BooleanTest:
|
||||||
case T_DistinctExpr:
|
case T_DistinctExpr:
|
||||||
|
case T_JsonIsPredicate:
|
||||||
switch (nodeTag(parentNode))
|
switch (nodeTag(parentNode))
|
||||||
{
|
{
|
||||||
case T_FuncExpr:
|
case T_FuncExpr:
|
||||||
|
@ -6381,6 +6382,40 @@ get_rule_expr(Node *node, deparse_context *context,
|
||||||
get_json_constructor((JsonConstructorExpr *) node, context, false);
|
get_json_constructor((JsonConstructorExpr *) node, context, false);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case T_JsonIsPredicate:
|
||||||
|
{
|
||||||
|
JsonIsPredicate *pred = (JsonIsPredicate *) node;
|
||||||
|
|
||||||
|
if (!PRETTY_PAREN(context))
|
||||||
|
appendStringInfoChar(context->buf, '(');
|
||||||
|
|
||||||
|
get_rule_expr_paren(pred->expr, context, true, node);
|
||||||
|
|
||||||
|
appendStringInfoString(context->buf, " IS JSON");
|
||||||
|
|
||||||
|
switch (pred->value_type)
|
||||||
|
{
|
||||||
|
case JS_TYPE_SCALAR:
|
||||||
|
appendStringInfoString(context->buf, " SCALAR");
|
||||||
|
break;
|
||||||
|
case JS_TYPE_ARRAY:
|
||||||
|
appendStringInfoString(context->buf, " ARRAY");
|
||||||
|
break;
|
||||||
|
case JS_TYPE_OBJECT:
|
||||||
|
appendStringInfoString(context->buf, " OBJECT");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pred->unique_keys)
|
||||||
|
appendStringInfoString(context->buf, " WITH UNIQUE KEYS");
|
||||||
|
|
||||||
|
if (!PRETTY_PAREN(context))
|
||||||
|
appendStringInfoChar(context->buf, ')');
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case T_List:
|
case T_List:
|
||||||
{
|
{
|
||||||
char *sep;
|
char *sep;
|
||||||
|
|
Loading…
Reference in New Issue