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 <[email protected]> Discussion: https://postgr.es/m/caa-alv7azgsexnbjjrw8ekkoxbu34tdoklla2gpye3ahjo5...@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/af6fad879fbf9b542cfde05c52695c9dffa6bb47 Modified Files -------------- src/backend/parser/parse_jsontable.c | 13 +++--------- src/backend/utils/adt/ruleutils.c | 4 ---- src/test/regress/expected/sqljson_jsontable.out | 27 ++++++++++++++++++++++++- src/test/regress/sql/sqljson_jsontable.sql | 15 ++++++++++++++ 4 files changed, 44 insertions(+), 15 deletions(-)
