mirror of
https://git.postgresql.org/git/postgresql.git
synced 2026-02-21 05:46:59 +08:00
SQL/JSON: Fix default ON ERROR behavior for JSON_TABLE
Use EMPTY ARRAY instead of EMPTY. This change does not affect the runtime behavior of JSON_TABLE(), which continues to return an empty relation ON ERROR. It only alters whether the default ON ERROR behavior is shown in the deparsed output. Reported-by: Jian He <jian.universality@gmail.com> Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com Backpatch-through: 17
This commit is contained in:
@ -552,3 +552,12 @@ CREATE VIEW json_table_view9 AS SELECT * from JSON_TABLE('"a"', '$' COLUMNS (a t
|
||||
\sv json_table_view9;
|
||||
|
||||
DROP VIEW json_table_view8, json_table_view9;
|
||||
|
||||
-- Test JSON_TABLE() deparsing -- don't emit default ON ERROR behavior
|
||||
CREATE VIEW json_table_view8 AS SELECT * from JSON_TABLE('"a"', '$' COLUMNS (a text PATH '$') EMPTY ON ERROR);
|
||||
\sv json_table_view8;
|
||||
|
||||
CREATE VIEW json_table_view9 AS SELECT * from JSON_TABLE('"a"', '$' COLUMNS (a text PATH '$') EMPTY ARRAY ON ERROR);
|
||||
\sv json_table_view9;
|
||||
|
||||
DROP VIEW json_table_view8, json_table_view9;
|
||||
|
||||
Reference in New Issue
Block a user