pgsql: SQL/JSON: Improve error-handling of JsonBehavior expressions

From: Amit Langote <amitlan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: SQL/JSON: Improve error-handling of JsonBehavior expressions
Date: 2024-07-26 07:43:29
Message-ID: E1sXFbt-001Gd7-Cu@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

SQL/JSON: Improve error-handling of JsonBehavior expressions

Instead of returning a NULL when the JsonBehavior expression value
could not be coerced to the RETURNING type, throw the error message
informing the user that it is the JsonBehavior expression that caused
the error with the actual coercion error message shown in its DETAIL
line.

Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d1dc4ae5608d9c0e83d5b5d32de238a7ac3d9a1a

Modified Files
--------------
src/backend/executor/execExprInterp.c | 78 +++++++++++++++++++++---
src/test/regress/expected/sqljson_jsontable.out | 7 +--
src/test/regress/expected/sqljson_queryfuncs.out | 21 ++-----
3 files changed, 78 insertions(+), 28 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Amit Langote 2024-07-26 07:43:43 pgsql: SQL/JSON: Respect OMIT QUOTES when RETURNING domains over jsonb
Previous Message Tom Lane 2024-07-25 23:52:23 pgsql: Doc: fix misleading syntax synopses for targetlists.