1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03:00

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.
This commit is contained in:
Amit Langote
2024-04-08 16:02:29 +09:00
parent b453a7a16a
commit 561b74ddb8
5 changed files with 41 additions and 26 deletions

View File

@ -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,