From: | Amit Langote <amitlan(at)postgresql(dot)org> |
---|---|
To: | pgsql-committers(at)lists(dot)postgresql(dot)org |
Subject: | pgsql: SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER) |
Date: | 2024-09-12 01:55:43 |
Message-ID: | E1soZ3f-000fnP-Gh@gemulon.postgresql.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-committers |
SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER)
Currently, when WITH CONDITIONAL WRAPPER is specified, array wrappers
are applied even to a single SQL/JSON item if it is a scalar JSON
value, but this behavior does not comply with the standard.
To fix, apply wrappers only when there are multiple SQL/JSON items
in the result.
Reported-by: Peter Eisentraut <peter(at)eisentraut(dot)org>
Author: Peter Eisentraut <peter(at)eisentraut(dot)org>
Author: Amit Langote <amitlangote09(at)gmail(dot)com>
Reviewed-by: Andrew Dunstan <andrew(at)dunslane(dot)net>
Discussion: https://postgr.es/m/8022e067-818b-45d3-8fab-6e0d94d03626%40eisentraut.org
Backpatch-through: 17
Branch
------
REL_17_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/2c27346ed6848b6f5505f1c57078a7c1978ae042
Modified Files
--------------
src/backend/utils/adt/jsonpath_exec.c | 24 +++++++++---
src/test/regress/expected/sqljson_queryfuncs.out | 49 +++++++++++-------------
src/test/regress/sql/sqljson_queryfuncs.sql | 13 +++----
3 files changed, 48 insertions(+), 38 deletions(-)
From | Date | Subject | |
---|---|---|---|
Next Message | Amit Langote | 2024-09-12 01:55:57 | pgsql: SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER) |
Previous Message | Tom Lane | 2024-09-11 15:42:55 | pgsql: Remove incorrect Assert. |