SQL/JSON: Improve error-handling of JsonBehavior expressions
authorAmit Langote <[email protected]>
Fri, 26 Jul 2024 07:00:16 +0000 (16:00 +0900)
committerAmit Langote <[email protected]>
Fri, 26 Jul 2024 07:36:06 +0000 (16:36 +0900)
commitd1dc4ae5608d9c0e83d5b5d32de238a7ac3d9a1a
tree6e3493d3a9fcbaf94e6a45ca28ed56c3a32e39db
parent79fa052e78804667739bee3f3e220f0ef6783b2c
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