mirror of
https://github.com/postgres/postgres.git
synced 2025-07-11 10:01:57 +03:00
RETURNING clause for JSON() and JSON_SCALAR()
This patch is extracted from a larger patch that allowed setting the default returned value from these functions to json or jsonb. That had problems, but this piece of it is fine. For these functions only json or jsonb can be specified in the RETURNING clause. Extracted from an original patch from Nikita Glukhov Reviewers have included (in no particular order) Andres Freund, Alexander Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zihong Yu, Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby. Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru
This commit is contained in:
@ -2354,6 +2354,7 @@ _copyJsonParseExpr(const JsonParseExpr *from)
|
||||
JsonParseExpr *newnode = makeNode(JsonParseExpr);
|
||||
|
||||
COPY_NODE_FIELD(expr);
|
||||
COPY_NODE_FIELD(output);
|
||||
COPY_SCALAR_FIELD(unique_keys);
|
||||
COPY_LOCATION_FIELD(location);
|
||||
|
||||
@ -2369,6 +2370,7 @@ _copyJsonScalarExpr(const JsonScalarExpr *from)
|
||||
JsonScalarExpr *newnode = makeNode(JsonScalarExpr);
|
||||
|
||||
COPY_NODE_FIELD(expr);
|
||||
COPY_NODE_FIELD(output);
|
||||
COPY_LOCATION_FIELD(location);
|
||||
|
||||
return newnode;
|
||||
|
Reference in New Issue
Block a user