postgresql/src/backend/utils
Amit Langote de3600452b Add basic JSON_TABLE() functionality
JSON_TABLE() allows JSON data to be converted into a relational view
and thus used, for example, in a FROM clause, like other tabular
data.  Data to show in the view is selected from a source JSON object
using a JSON path expression to get a sequence of JSON objects that's
called a "row pattern", which becomes the source to compute the
SQL/JSON values that populate the view's output columns.  Column
values themselves are computed using JSON path expressions applied to
each of the JSON objects comprising the "row pattern", for which the
SQL/JSON query functions added in 6185c9737c are used.

To implement JSON_TABLE() as a table function, this augments the
TableFunc and TableFuncScanState nodes that are currently used to
support XMLTABLE() with some JSON_TABLE()-specific fields.

Note that the JSON_TABLE() spec includes NESTED COLUMNS and PLAN
clauses, which are required to provide more flexibility to extract
data out of nested JSON objects, but they are not implemented here
to keep this commit of manageable size.

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: 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

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+HiwqE4XTdfb1nW=Ojoy_tQSRhYt-q_kb6i5d4xcKyrLC1Nbg@mail.gmail.com
2024-04-04 20:20:15 +09:00
..
activity Implement pg_wal_replay_wait() stored procedure 2024-04-02 22:48:03 +03:00
adt Add basic JSON_TABLE() functionality 2024-04-04 20:20:15 +09:00
cache Add error codes to some PANIC/FATAL errors reports 2024-04-03 09:19:25 +02:00
error Coordinate emit_log_hook and all log destinations to share the same timeval 2024-04-04 14:15:22 +09:00
fmgr Refactor code checking for file existence 2024-01-12 12:04:51 +09:00
hash Mark hash_corrupted() as pg_attribute_noreturn. 2024-03-17 17:54:45 -04:00
init Refactor postmaster child process launching 2024-03-18 11:35:30 +02:00
mb Make the order of the header file includes consistent 2024-03-13 15:07:00 +01:00
misc Provide vectored variant of ReadBuffer(). 2024-04-03 00:23:20 +13:00
mmgr Allow specifying initial and maximum segment sizes for DSA. 2024-03-27 11:43:29 +09:00
resowner Use new overflow-safe integer comparison functions. 2024-02-16 14:05:36 -06:00
sort Clarify comment for LogicalTapeSetBlocks(). 2024-03-25 11:51:44 -07:00
time Remove unused #include's from backend .c files 2024-03-04 12:02:20 +01:00
.gitignore Rearrange makefile rules for running Gen_fmgrtab.pl. 2018-05-03 17:54:18 -04:00
Gen_dummy_probes.pl Update copyright for 2024 2024-01-03 20:49:05 -05:00
Gen_fmgrtab.pl Update copyright for 2024 2024-01-03 20:49:05 -05:00
Makefile Update copyright for 2024 2024-01-03 20:49:05 -05:00
errcodes.txt Introduce transaction_timeout 2024-02-15 23:56:12 +02:00
generate-errcodes.pl Update copyright for 2024 2024-01-03 20:49:05 -05:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
postprocess_dtrace.sed Update copyright for 2024 2024-01-03 20:49:05 -05:00
probes.d Update copyright for 2024 2024-01-03 20:49:05 -05:00