mirror of https://github.com/citusdata/citus.git
Ruleutils_17 Add more SQL/JSON constructor functions
Relevant PG commit:
03734a7fed7d924679770adb78a7db8a37d14188
03734a7fed
m3hm3t/pg17_isolation_test_cmd_from
parent
728fe5c921
commit
978fdc2166
|
@ -7622,6 +7622,15 @@ get_json_constructor(JsonConstructorExpr *ctor, deparse_context *context,
|
|||
case JSCTOR_JSON_ARRAY:
|
||||
funcname = "JSON_ARRAY";
|
||||
break;
|
||||
case JSCTOR_JSON_PARSE:
|
||||
funcname = "JSON";
|
||||
break;
|
||||
case JSCTOR_JSON_SCALAR:
|
||||
funcname = "JSON_SCALAR";
|
||||
break;
|
||||
case JSCTOR_JSON_SERIALIZE:
|
||||
funcname = "JSON_SERIALIZE";
|
||||
break;
|
||||
default:
|
||||
elog(ERROR, "invalid JsonConstructorType %d", ctor->type);
|
||||
}
|
||||
|
@ -7669,6 +7678,11 @@ get_json_constructor_options(JsonConstructorExpr *ctor, StringInfo buf)
|
|||
if (ctor->unique)
|
||||
appendStringInfoString(buf, " WITH UNIQUE KEYS");
|
||||
|
||||
/*
|
||||
* Append RETURNING clause if needed; JSON() and JSON_SCALAR() don't
|
||||
* support one.
|
||||
*/
|
||||
if (ctor->type != JSCTOR_JSON_PARSE && ctor->type != JSCTOR_JSON_SCALAR)
|
||||
get_json_returning(ctor->returning, buf, true);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue