]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Revert cascading of JSON_TABLE's ON ERROR
authorAlexander Korotkov <akorotkov@postgresql.org>
Tue, 14 Jul 2026 21:46:40 +0000 (00:46 +0300)
committerAlexander Korotkov <akorotkov@postgresql.org>
Tue, 14 Jul 2026 21:46:40 +0000 (00:46 +0300)
commitaf6fad879fbf9b542cfde05c52695c9dffa6bb47
treea934c109dccfad2c63641db84da0d715e58b257a
parentd15a6bc2e16d4b330d6d455e41ce1ab3395d8e03
Revert cascading of JSON_TABLE's ON ERROR

86ab7f4c721d commit made the table-level ON ERROR clause serve as the default
ON ERROR for columns lacking their own, so that a top-level ERROR ON ERROR
turned per-column evaluation errors into hard errors.

The SQL standard does mandate this cascade, but introducing it should be
a deliberate, separately-documented change, so restore the previous
behavior for now.  This also reverts the paired ruleutils.c logic that
deparsed a column's behavior against an ERROR default: that dropped an
explicit ERROR ON EMPTY from a dumped view, and otherwise emitted a
redundant NULL ON EMPTY.

Reported-by: Thom Brown <thom@linux.com>
Discussion: https://postgr.es/m/CAA-aLv7aZGSExnbjJRw8eKkoXbu34TdoKLLA2gPye3aHjO5OSA@mail.gmail.com
src/backend/parser/parse_jsontable.c
src/backend/utils/adt/ruleutils.c
src/test/regress/expected/sqljson_jsontable.out
src/test/regress/sql/sqljson_jsontable.sql