postgresql/src/interfaces/ecpg/test/sql
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
..
.gitignore Add missing .gitignore entries. 2023-03-29 09:16:53 -04:00
Makefile Add basic JSON_TABLE() functionality 2024-04-04 20:20:15 +09:00
array.pgc Fix format truncation issue from ECPG test 2019-08-02 09:51:12 +09:00
binary.pgc Make some ecpg test cases more robust against unexpected errors that happen 2019-01-30 10:39:32 +01:00
bytea.pgc Fix ecpg crash with bytea and cursor variables. 2020-06-30 18:34:41 +02:00
code100.pgc Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
copystdout.pgc Updated parser file to the one generated by the latest version of parse.[awk|pl] from the latest version of gram.y 2008-11-13 11:54:39 +00:00
createtableas.pgc Sync ECPG's CREATE TABLE AS statement with backend's. 2019-02-18 11:57:34 +01:00
declare.pgc Improved ECPG warning as suggested by Michael Paquier and removed test case 2021-08-17 15:01:09 +02:00
define.pgc Hopefully that's it. The remaining files for ecpg regression tests. 2006-08-02 14:14:04 +00:00
desc.pgc Always use the same way to addres a descriptor in ecpg's regression tests. 2014-01-13 10:41:53 +01:00
describe.pgc Remove unnecessary parentheses in return statements 2017-09-05 14:52:55 -04:00
dynalloc.pgc Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
dynalloc2.pgc Remove useless whitespace at end of lines 2010-11-23 22:34:55 +02:00
dyntest.pgc Avoid premature de-doubling of quote marks in ECPG strings. 2020-10-22 18:29:46 -04:00
execute.pgc Add documentation and tests for quote marks in ECPG literal queries. 2020-10-22 18:29:46 -04:00
fetch.pgc Make some ecpg test cases more robust against unexpected errors that happen 2019-01-30 10:39:32 +01:00
func.pgc More variables gcc moans about 2009-05-20 16:39:56 +00:00
indicators.pgc More variables gcc moans about 2009-05-20 16:39:56 +00:00
insupd.pgc Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
meson.build Add basic JSON_TABLE() functionality 2024-04-04 20:20:15 +09:00
oldexec.pgc Remove unnecessary parentheses in return statements 2017-09-05 14:52:55 -04:00
parser.pgc Fix whitespace issues found by git diff --check, add gitattributes 2013-11-10 14:48:29 -05:00
prepareas.pgc Implement PREPARE AS statement for ECPG. 2019-05-22 04:58:29 +02:00
quote.pgc Make some ecpg test cases more robust against unexpected errors that happen 2019-01-30 10:39:32 +01:00
show.pgc More variables gcc moans about 2009-05-20 16:39:56 +00:00
sqlda.pgc Remove HAVE_LONG_LONG_INT 2019-11-07 13:30:04 +01:00
sqljson.pgc Add more SQL/JSON constructor functions 2023-07-26 17:08:33 +09:00
sqljson_jsontable.pgc Add basic JSON_TABLE() functionality 2024-04-04 20:20:15 +09:00
twophase.pgc Remove unnecessary parentheses in return statements 2017-09-05 14:52:55 -04:00