SQL/JSON: Improve error-handling of JsonBehavior expressions
authorAmit Langote <amitlan@postgresql.org>
Fri, 26 Jul 2024 07:00:16 +0000 (16:00 +0900)
committerAmit Langote <amitlan@postgresql.org>
Fri, 26 Jul 2024 07:00:56 +0000 (16:00 +0900)
commit231b7d670b218d6a5cde0574cf160c8157ab91fb
tree4d901820246068b4a1559fce75c6214a817034e9
parent63e6c5f4a2eeb22e0dd446a62c2b4b417d2b51f0
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
src/backend/executor/execExprInterp.c
src/test/regress/expected/sqljson_jsontable.out
src/test/regress/expected/sqljson_queryfuncs.out