From ef744ebb7340d42361ebd88d068b27b17e69de18 Mon Sep 17 00:00:00 2001 From: Amit Langote Date: Thu, 18 Apr 2024 14:38:12 +0900 Subject: SQL/JSON: Miscellaneous fixes and improvements This addresses some post-commit review comments for commits 6185c973, de3600452, and 9425c596a0, with the following changes: * Fix JSON_TABLE() syntax documentation to use the term "path_expression" for JSON path expressions instead of "json_path_specification" to be consistent with the other SQL/JSON functions. * Fix a typo in the example code in JSON_TABLE() documentation. * Rewrite some newly added comments in jsonpath.h. * In JsonPathQuery(), add missing cast to int before printing an enum value. Reported-by: Jian He Discussion: https://postgr.es/m/CACJufxG_e0QLCgaELrr2ZNz7AxPeGCNKAORe3fHtFCQLsH4J4Q@mail.gmail.com --- src/include/utils/jsonpath.h | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src/include/utils/jsonpath.h') diff --git a/src/include/utils/jsonpath.h b/src/include/utils/jsonpath.h index 0bcc1ac569d..69c180c2e29 100644 --- a/src/include/utils/jsonpath.h +++ b/src/include/utils/jsonpath.h @@ -281,12 +281,9 @@ extern JsonPathParseResult *parsejsonpath(const char *str, int len, extern bool jspConvertRegexFlags(uint32 xflags, int *result, struct Node *escontext); - /* - * Evaluation of jsonpath + * Struct for details about external variables passed into jsonpath executor */ - -/* External variable passed into jsonpath. */ typedef struct JsonPathVariable { char *name; @@ -297,7 +294,7 @@ typedef struct JsonPathVariable } JsonPathVariable; -/* SQL/JSON item */ +/* SQL/JSON query functions */ 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, @@ -306,6 +303,7 @@ extern JsonbValue *JsonPathValue(Datum jb, JsonPath *jp, bool *empty, bool *error, List *vars, const char *column_name); +/* For JSON_TABLE() */ extern PGDLLIMPORT const TableFuncRoutine JsonbTableRoutine; #endif -- cgit v1.2.3