From 561b74ddb8781f8c0511f6473c51fb51c8c6b087 Mon Sep 17 00:00:00 2001 From: Amit Langote Date: Mon, 8 Apr 2024 16:02:29 +0900 Subject: Fix restriction on specifying KEEP QUOTES in JSON_QUERY() Currently, transformJsonFuncExpr() enforces some restrictions on the combinations of QUOTES and WRAPPER clauses that can be specified in JSON_QUERY(). The intent was to only prevent the useless combination WITH WRAPPER OMIT QUOTES, but the coding prevented KEEP QUOTES too, which is not helpful. Fix that. --- src/backend/parser/parse_expr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/backend/parser/parse_expr.c') diff --git a/src/backend/parser/parse_expr.c b/src/backend/parser/parse_expr.c index 56a531de8db..4c98d7a046c 100644 --- a/src/backend/parser/parse_expr.c +++ b/src/backend/parser/parse_expr.c @@ -4300,7 +4300,7 @@ transformJsonFuncExpr(ParseState *pstate, JsonFuncExpr *func) /* OMIT QUOTES is meaningless when strings are wrapped. */ if (func->op == JSON_QUERY_OP && - func->quotes != JS_QUOTES_UNSPEC && + func->quotes == JS_QUOTES_OMIT && (func->wrapper == JSW_CONDITIONAL || func->wrapper == JSW_UNCONDITIONAL)) ereport(ERROR, -- cgit v1.2.3