=== Applying patches on top of PostgreSQL commit ID 53a49365052026907afff7613929710d1e7f0da0 === /etc/rc.d/jail: WARNING: Per-jail configuration via jail_* variables is obsolete. Please consider migrating to /etc/jail.conf. Sat Feb 1 01:07:29 UTC 2025 On branch cf/5478 nothing to commit, working tree clean === applying patch ./v18-0001-JSON-TABLE-PLAN-clause.patch Applied patch to 'src/backend/nodes/makefuncs.c' cleanly. Applied patch to 'src/backend/parser/gram.y' cleanly. Applied patch to 'src/backend/parser/parse_jsontable.c' cleanly. Applied patch to 'src/backend/utils/adt/jsonpath_exec.c' cleanly. Applied patch to 'src/backend/utils/adt/ruleutils.c' cleanly. Applied patch to 'src/include/nodes/makefuncs.h' cleanly. Applied patch to 'src/include/nodes/parsenodes.h' cleanly. Applied patch to 'src/include/nodes/primnodes.h' cleanly. Applied patch to 'src/test/regress/expected/sqljson_jsontable.out' with conflicts. Applied patch to 'src/test/regress/sql/sqljson_jsontable.sql' cleanly. Applied patch to 'src/tools/pgindent/typedefs.list' cleanly. U src/test/regress/expected/sqljson_jsontable.out diff --cc src/test/regress/expected/sqljson_jsontable.out index 458c5aaa5b,1b0240b148..0000000000 --- a/src/test/regress/expected/sqljson_jsontable.out +++ b/src/test/regress/expected/sqljson_jsontable.out @@@ -710,10 -809,45 +809,49 @@@ LINE 1: SELECT * FROM JSON_TABLE(jsonb ^ -- JsonPathQuery() error message mentioning column name SELECT * FROM JSON_TABLE('{"a": [{"b": "1"}, {"b": "2"}]}', '$' COLUMNS (b json path '$.a[*].b' ERROR ON ERROR)); ++<<<<<<< ours +ERROR: JSON path expression for column "b" must return single item when no wrapper is requested ++======= + ERROR: JSON path expression in JSON_QUERY should return single item without wrapper ++>>>>>>> theirs HINT: Use the WITH WRAPPER clause to wrap SQL/JSON items into an array. - -- JSON_TABLE: nested paths - -- Duplicate path names + -- JSON_TABLE: nested paths and plans + -- Should fail (JSON_TABLE columns must contain explicit AS path + -- specifications if explicit PLAN clause is used) + SELECT * FROM JSON_TABLE( + jsonb '[]', '$' -- AS required here + COLUMNS ( + foo int PATH '$' + ) + PLAN DEFAULT (UNION) + ) jt; + ERROR: invalid JSON_TABLE expression + LINE 2: jsonb '[]', '$' -- AS required here + ^ + DETAIL: JSON_TABLE path must contain explicit AS pathname specification if explicit PLAN clause is used + SELECT * FROM JSON_TABLE( + jsonb '[]', '$' AS path1 + COLUMNS ( + NESTED PATH '$' COLUMNS ( -- AS required here + foo int PATH '$' + ) + ) + PLAN DEFAULT (UNION) + ) jt; + ERROR: invalid JSON_TABLE expression + LINE 4: NESTED PATH '$' COLUMNS ( -- AS required here + ^ + DETAIL: JSON_TABLE path must contain explicit AS pathname specification if explicit PLAN clause is used + -- Should fail (column names must be distinct) + SELECT * FROM JSON_TABLE( + jsonb '[]', '$' AS a + COLUMNS ( + a int + ) + ) jt; + ERROR: duplicate JSON_TABLE column or path name: a + LINE 4: a int + ^ SELECT * FROM JSON_TABLE( jsonb '[]', '$' AS a COLUMNS (