Thread: pgsql: Common SQL/JSON clauses

pgsql: Common SQL/JSON clauses

From
Andrew Dunstan
Date:
Common SQL/JSON clauses

This introduces some of the building blocks used by the SQL/JSON
constructor and query functions. Specifically, it provides node
executor and grammar support for the FORMAT JSON [ENCODING foo]
clause, and values decorated with it, and for the RETURNING clause.

The following SQL/JSON patches will leverage these.

Nikita Glukhov (who probably deserves an award for perseverance).

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f79b803dcc98d707450e158db3638dc67ff8380b

Modified Files
--------------
src/backend/executor/execExpr.c      |  22 +++++
src/backend/nodes/copyfuncs.c        |  55 +++++++++++
src/backend/nodes/equalfuncs.c       |  39 ++++++++
src/backend/nodes/makefuncs.c        |  54 +++++++++++
src/backend/nodes/nodeFuncs.c        |  66 +++++++++++++
src/backend/nodes/outfuncs.c         |  39 ++++++++
src/backend/nodes/readfuncs.c        |  51 ++++++++++
src/backend/optimizer/util/clauses.c |  23 +++++
src/backend/parser/gram.y            |  65 ++++++++++++-
src/backend/parser/parse_expr.c      | 181 +++++++++++++++++++++++++++++++++++
src/backend/utils/adt/ruleutils.c    |  56 +++++++++++
src/backend/utils/misc/queryjumble.c |  26 +++++
src/include/nodes/makefuncs.h        |   5 +
src/include/nodes/nodes.h            |   4 +
src/include/nodes/parsenodes.h       |  13 +++
src/include/nodes/primnodes.h        |  59 ++++++++++++
src/include/parser/kwlist.h          |   2 +
17 files changed, 758 insertions(+), 2 deletions(-)