SQL/JSON: Improve some error messages
Amit Langote <amitlan@postgresql.org>
SQL/JSON: Improve some error messages This improves some error messages emitted by SQL/JSON query functions by mentioning column name when available, such as when they are invoked as part of evaluating JSON_TABLE() columns. To do so, a new field column_name is added to both JsonFuncExpr and JsonExpr that is only populated when creating those nodes for transformed JSON_TABLE() columns. While at it, relevant error messages are reworded for clarity. Reported-by: Jian He <jian.universality@gmail.com> Suggested-by: Jian He <jian.universality@gmail.com> Discussion: https://postgr.es/m/CACJufxG_e0QLCgaELrr2ZNz7AxPeGCNKAORe3fHtFCQLsH4J4Q@mail.gmail.com
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/executor/execExprInterp.c | modified | +24 −19 |
| src/backend/parser/parse_expr.c | modified | +1 −0 |
| src/backend/parser/parse_jsontable.c | modified | +4 −6 |
| src/backend/utils/adt/jsonpath_exec.c | modified | +33 −12 |
| src/include/nodes/parsenodes.h | modified | +2 −0 |
| src/include/nodes/primnodes.h | modified | +3 −0 |
| src/include/utils/jsonpath.h | modified | +4 −2 |
| src/test/regress/expected/sqljson_jsontable.out | modified | +7 −3 |
| src/test/regress/expected/sqljson_queryfuncs.out | modified | +15 −15 |
| src/test/regress/sql/sqljson_jsontable.sql | modified | +3 −0 |
Discussion
- sql/json remaining issue 10 messages · 2024-04-09 → 2024-04-26