git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: 3d067c5) | patch
SQL/JSON query functions
Thu, 3 Mar 2022 18:11:14 +0000 (13:11 -0500)
2022年3月29日 20:57:13 +0000 (16:57 -0400)
commit 1a36bc9dba8eae90963a586d37b6457b32b2fed4
SQL/JSON query functions

This introduces the SQL/JSON functions for querying JSON data using
jsonpath expressions. The functions are:

JSON_EXISTS()
JSON_QUERY()
JSON_VALUE()

All of these functions only operate on jsonb. The workaround for now is
to cast the argument to jsonb.

JSON_EXISTS() tests if the jsonpath expression applied to the jsonb
value yields any values. JSON_VALUE() must return a single value, and an
error occurs if it tries to return multiple values. JSON_QUERY() must
return a json object or array, and there are various WRAPPER options for
handling scalar or multi-value results. Both these functions have
options for handling EMPTY and ERROR conditions.

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
39 files changed:
src/backend/executor/execExpr.c diff | blob | blame | history
src/backend/executor/execExprInterp.c diff | blob | blame | history
src/backend/jit/llvm/llvmjit_expr.c diff | blob | blame | history
src/backend/jit/llvm/llvmjit_types.c diff | blob | blame | history
src/backend/nodes/copyfuncs.c diff | blob | blame | history
src/backend/nodes/equalfuncs.c diff | blob | blame | history
src/backend/nodes/makefuncs.c diff | blob | blame | history
src/backend/nodes/nodeFuncs.c diff | blob | blame | history
src/backend/nodes/outfuncs.c diff | blob | blame | history
src/backend/nodes/readfuncs.c diff | blob | blame | history
src/backend/optimizer/path/costsize.c diff | blob | blame | history
src/backend/optimizer/util/clauses.c diff | blob | blame | history
src/backend/parser/gram.y diff | blob | blame | history
src/backend/parser/parse_collate.c diff | blob | blame | history
src/backend/parser/parse_expr.c diff | blob | blame | history
src/backend/parser/parse_target.c diff | blob | blame | history
src/backend/utils/adt/formatting.c diff | blob | blame | history
src/backend/utils/adt/jsonb.c diff | blob | blame | history
src/backend/utils/adt/jsonfuncs.c diff | blob | blame | history
src/backend/utils/adt/jsonpath.c diff | blob | blame | history
src/backend/utils/adt/jsonpath_exec.c diff | blob | blame | history
src/backend/utils/adt/ruleutils.c diff | blob | blame | history
src/backend/utils/misc/queryjumble.c diff | blob | blame | history
src/include/executor/execExpr.h diff | blob | blame | history
src/include/executor/executor.h diff | blob | blame | history
src/include/nodes/makefuncs.h diff | blob | blame | history
src/include/nodes/nodes.h diff | blob | blame | history
src/include/nodes/parsenodes.h diff | blob | blame | history
src/include/nodes/primnodes.h diff | blob | blame | history
src/include/parser/kwlist.h diff | blob | blame | history
src/include/utils/formatting.h diff | blob | blame | history
src/include/utils/jsonb.h diff | blob | blame | history
src/include/utils/jsonfuncs.h diff | blob | blame | history
src/include/utils/jsonpath.h diff | blob | blame | history
src/test/regress/expected/json_sqljson.out [new file with mode: 0644] blob
src/test/regress/expected/jsonb_sqljson.out [new file with mode: 0644] blob
src/test/regress/parallel_schedule diff | blob | blame | history
src/test/regress/sql/json_sqljson.sql [new file with mode: 0644] blob
src/test/regress/sql/jsonb_sqljson.sql [new file with mode: 0644] blob
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /