pgsql: SQL/JSON: add standard JSON constructor functions - Mailing list pgsql-committers
From | Alvaro Herrera |
---|---|
Subject | pgsql: SQL/JSON: add standard JSON constructor functions |
Date | |
Msg-id | [email protected] Whole thread Raw |
Responses |
Re: pgsql: SQL/JSON: add standard JSON constructor functions
|
List | pgsql-committers |
SQL/JSON: add standard JSON constructor functions This commit introduces the SQL/JSON standard-conforming constructors for JSON types: JSON_ARRAY() JSON_ARRAYAGG() JSON_OBJECT() JSON_OBJECTAGG() Most of the functionality was already present in PostgreSQL-specific functions, but these include some new functionality such as the ability to skip or include NULL values, and to allow duplicate keys or throw error when they are found, as well as the standard specified syntax to specify output type and format. Author: Nikita Glukhov <[email protected]> Author: Teodor Sigaev <[email protected]> Author: Oleg Bartunov <[email protected]> Author: Alexander Korotkov <[email protected]> Author: Amit Langote <[email protected]> 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/CAF4Au4w2x-5LTnN_bxky-mq4=WOqsGsxSpENCzHRAzSnEd8+WQ@mail.gmail.com Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/[email protected] Discussion: https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.org Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/7081ac46ace8c459966174400b53418683c9fe5c Modified Files -------------- doc/src/sgml/func.sgml | 286 +++++++- src/backend/executor/execExpr.c | 91 +++ src/backend/executor/execExprInterp.c | 50 ++ src/backend/jit/llvm/llvmjit_expr.c | 6 + src/backend/jit/llvm/llvmjit_types.c | 1 + src/backend/nodes/makefuncs.c | 69 ++ src/backend/nodes/nodeFuncs.c | 221 ++++++ src/backend/optimizer/util/clauses.c | 55 ++ src/backend/parser/gram.y | 257 ++++++- src/backend/parser/parse_expr.c | 770 +++++++++++++++++++++ src/backend/parser/parse_target.c | 18 + src/backend/parser/parser.c | 26 + src/backend/utils/adt/json.c | 434 ++++++++++-- src/backend/utils/adt/jsonb.c | 236 +++++-- src/backend/utils/adt/jsonb_util.c | 56 +- src/backend/utils/adt/ruleutils.c | 275 +++++++- src/include/catalog/catversion.h | 2 +- src/include/catalog/pg_aggregate.dat | 22 + src/include/catalog/pg_proc.dat | 74 ++ src/include/executor/execExpr.h | 26 + src/include/nodes/makefuncs.h | 6 + src/include/nodes/parsenodes.h | 107 +++ src/include/nodes/primnodes.h | 85 +++ src/include/parser/kwlist.h | 8 + src/include/utils/json.h | 6 + src/include/utils/jsonb.h | 9 + src/interfaces/ecpg/preproc/parse.pl | 2 + src/interfaces/ecpg/preproc/parser.c | 22 + src/interfaces/ecpg/test/ecpg_schedule | 1 + src/interfaces/ecpg/test/expected/sql-sqljson.c | 203 ++++++ .../ecpg/test/expected/sql-sqljson.stderr | 69 ++ .../ecpg/test/expected/sql-sqljson.stdout | 6 + src/interfaces/ecpg/test/sql/Makefile | 1 + src/interfaces/ecpg/test/sql/meson.build | 1 + src/interfaces/ecpg/test/sql/sqljson.pgc | 44 ++ src/test/regress/expected/json.out | 11 +- src/test/regress/expected/opr_sanity.out | 6 +- src/test/regress/expected/sqljson.out | 756 ++++++++++++++++++++ src/test/regress/parallel_schedule | 2 +- src/test/regress/sql/opr_sanity.sql | 6 +- src/test/regress/sql/sqljson.sql | 284 ++++++++ src/tools/pgindent/typedefs.list | 1 + 42 files changed, 4470 insertions(+), 141 deletions(-)
pgsql-committers by date: