postgresql/src/backend/utils/adt
Amit Langote 6185c9737c Add SQL/JSON query functions
This introduces the following SQL/JSON functions for querying JSON
data using jsonpath expressions:

JSON_EXISTS(), which can be used to apply a jsonpath expression to a
JSON value to check if it yields any values.

JSON_QUERY(), which can be used to to apply a jsonpath expression to
a JSON value to get a JSON object, an array, or a string.  There are
various options to control whether multi-value result uses array
wrappers and whether the singleton scalar strings are quoted or not.

JSON_VALUE(), which can be used to apply a jsonpath expression to a
JSON value to return a single scalar value, producing an error if it
multiple values are matched.

Both JSON_VALUE() and JSON_QUERY() functions have options for
handling EMPTY and ERROR conditions, which can be used to specify
the behavior when no values are matched and when an error occurs
during jsonpath evaluation, respectively.

Author: Nikita Glukhov <n.gluhov@postgrespro.ru>
Author: Teodor Sigaev <teodor@sigaev.ru>
Author: Oleg Bartunov <obartunov@gmail.com>
Author: Alexander Korotkov <aekorotkov@gmail.com>
Author: Andrew Dunstan <andrew@dunslane.net>
Author: Amit Langote <amitlangote09@gmail.com>
Author: Peter Eisentraut <peter@eisentraut.org>
Author: Jian He <jian.universality@gmail.com>

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, Álvaro Herrera, Jian He, Anton A. Melnikov,
Nikita Malakhov, Peter Eisentraut, Tomas Vondra

Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru
Discussion: https://postgr.es/m/20220616233130.rparivafipt6doj3@alap3.anarazel.de
Discussion: https://postgr.es/m/abd9b83b-aa66-f230-3d6d-734817f0995d%40postgresql.org
Discussion: https://postgr.es/m/CA+HiwqHROpf9e644D8BRqYvaAPmgBZVup-xKMDPk-nd4EpgzHw@mail.gmail.com
Discussion: https://postgr.es/m/CA+HiwqE4XTdfb1nW=Ojoy_tQSRhYt-q_kb6i5d4xcKyrLC1Nbg@mail.gmail.com
2024-03-21 17:07:03 +09:00
..
.gitignore Build all Flex files standalone 2022-09-04 12:09:01 +07:00
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
acl.c Reintroduce MAINTAIN privilege and pg_maintain predefined role. 2024-03-13 14:49:26 -05:00
amutils.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
array_expanded.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
array_selfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
array_typanalyze.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
array_userfuncs.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
arrayfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
arraysubs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
arrayutils.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
ascii.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
bool.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
cash.c Convert a few more datatype input functions to report errors softly. 2022-12-14 18:03:11 -05:00
char.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
cryptohashfuncs.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
date.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
datetime.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
datum.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
dbsize.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
domains.c Adjust populate_record_field() to handle errors softly 2024-01-24 15:04:33 +09:00
encode.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
enum.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
expandeddatum.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
expandedrecord.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
float.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
format_type.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
formatting.c Add SQL/JSON query functions 2024-03-21 17:07:03 +09:00
genfile.c Remove the adminpack contrib extension 2024-03-04 12:39:22 +01:00
geo_ops.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
geo_selfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
geo_spgist.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
hbafuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
inet_cidr_ntop.c Avoid conflicts with library versions of inet_net_ntop() and friends. 2019-08-18 19:27:23 -04:00
inet_net_pton.c Avoid conflicts with library versions of inet_net_ntop() and friends. 2019-08-18 19:27:23 -04:00
int.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
int8.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
json.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
jsonb.c Add SQL/JSON query functions 2024-03-21 17:07:03 +09:00
jsonb_gin.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
jsonb_op.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
jsonb_util.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
jsonbsubs.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
jsonfuncs.c Add SQL/JSON query functions 2024-03-21 17:07:03 +09:00
jsonpath.c Add SQL/JSON query functions 2024-03-21 17:07:03 +09:00
jsonpath_exec.c Add SQL/JSON query functions 2024-03-21 17:07:03 +09:00
jsonpath_gram.y Implement various jsonpath methods 2024-01-25 10:15:43 -05:00
jsonpath_internal.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
jsonpath_scan.l Implement various jsonpath methods 2024-01-25 10:15:43 -05:00
levenshtein.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
like.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
like_match.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
like_support.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
lockfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
mac.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
mac8.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
mcxtfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
misc.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
multirangetypes.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
multirangetypes_selfuncs.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
name.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
network.c Work around spurious compiler warning in inet operators 2023-03-16 14:48:45 -07:00
network_gist.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
network_selfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
network_spgist.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
numeric.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
numutils.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
oid.c Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
oracle_compat.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
orderedsetaggs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
partitionfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_locale.c Support C.UTF-8 locale in the new builtin collation provider. 2024-03-19 15:24:41 -07:00
pg_lsn.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pg_upgrade_support.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
pgstatfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
pseudotypes.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
quote.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
rangetypes.c Add planner support functions for range operators <@ and @>. 2024-01-20 13:57:54 -05:00
rangetypes_gist.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
rangetypes_selfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
rangetypes_spgist.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
rangetypes_typanalyze.c Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
regexp.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
regproc.c Add to_regtypemod function to extract typemod from a string type name. 2024-03-20 17:11:28 -04:00
ri_triggers.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
rowtypes.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
ruleutils.c Add SQL/JSON query functions 2024-03-21 17:07:03 +09:00
selfuncs.c Allow examine_simple_variable() to work on INSERT RETURNING Vars. 2024-01-08 11:48:44 -05:00
tid.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
timestamp.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
trigfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tsginidx.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tsgistidx.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tsquery.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
tsquery_cleanup.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
tsquery_gist.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tsquery_op.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tsquery_rewrite.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
tsquery_util.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
tsrank.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tsvector.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tsvector_op.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
tsvector_parser.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
uuid.c Add some UUID support functions 2024-03-19 09:32:04 +01:00
varbit.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
varchar.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
varlena.c Add pg_column_toast_chunk_id(). 2024-03-14 10:58:00 -05:00
version.c Update copyright for 2024 2024-01-03 20:49:05 -05:00
windowfuncs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
xid.c Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
xid8funcs.c Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
xml.c Add destroyStringInfo function for cleaning up StringInfos 2024-03-16 23:18:28 +01:00