RETURNING clause for JSON() and JSON_SCALAR()
authorAndrew Dunstan <[email protected]>
Sat, 5 Mar 2022 13:07:15 +0000 (08:07 -0500)
committerAndrew Dunstan <[email protected]>
Thu, 31 Mar 2022 19:45:24 +0000 (15:45 -0400)
commit49082c2cc3d8167cca70cfe697afb064710828ca
tree004b744b04f1014bf82634f08ea62f98e6e619f7
parentad43a413c4f7f5d024a5b2f51e00d280a22f1874
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
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/nodes/nodeFuncs.c
src/backend/parser/gram.y
src/backend/parser/parse_expr.c
src/backend/utils/adt/ruleutils.c
src/include/nodes/parsenodes.h
src/test/regress/expected/sqljson.out
src/test/regress/sql/sqljson.sql