diff options
author | Amit Langote <amitlan@postgresql.org> | 2024-04-08 16:02:29 +0900 |
---|---|---|
committer | Amit Langote <amitlan@postgresql.org> | 2024-04-08 16:02:29 +0900 |
commit | 561b74ddb8781f8c0511f6473c51fb51c8c6b087 (patch) | |
tree | 78603f13636119e93393db6cf67e8b4e4f380583 /src/backend/parser/parse_expr.c | |
parent | b453a7a16a7ed2ba96522e521143bc652b74875f (diff) | |
download | postgresql-561b74ddb8781f8c0511f6473c51fb51c8c6b087.tar.gz postgresql-561b74ddb8781f8c0511f6473c51fb51c8c6b087.zip |
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.
Diffstat (limited to 'src/backend/parser/parse_expr.c')
-rw-r--r-- | src/backend/parser/parse_expr.c | 2 |
1 files changed, 1 insertions, 1 deletions
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, |