mirror of
https://github.com/postgres/postgres.git
synced 2026-01-29 12:02:15 +03:00
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
This commit is contained in:
@@ -300,9 +300,11 @@ typedef struct JsonPathVariable
|
||||
/* SQL/JSON item */
|
||||
extern bool JsonPathExists(Datum jb, JsonPath *path, bool *error, List *vars);
|
||||
extern Datum JsonPathQuery(Datum jb, JsonPath *jp, JsonWrapper wrapper,
|
||||
bool *empty, bool *error, List *vars);
|
||||
bool *empty, bool *error, List *vars,
|
||||
const char *column_name);
|
||||
extern JsonbValue *JsonPathValue(Datum jb, JsonPath *jp, bool *empty,
|
||||
bool *error, List *vars);
|
||||
bool *error, List *vars,
|
||||
const char *column_name);
|
||||
|
||||
extern PGDLLIMPORT const TableFuncRoutine JsonbTableRoutine;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user