pgsql: SQL/JSON: Respect OMIT QUOTES when RETURNING domains over jsonb

From: Amit Langote <amitlan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: SQL/JSON: Respect OMIT QUOTES when RETURNING domains over jsonb
Date: 2024-07-26 07:43:43
Message-ID: E1sXFc7-001GeB-2i@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

SQL/JSON: Respect OMIT QUOTES when RETURNING domains over jsonb

populate_domain() didn't take into account the omit_quotes flag passed
down to json_populate_type() by ExecEvalJsonCoercion() and that led
to incorrect behavior when the RETURNING type is a domain over
jsonb. Fix that by passing the flag by adding a new function
parameter to populate_domain().

Reported-by: Jian He <jian(dot)universality(at)gmail(dot)com>
Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/4fc6a555606de003690d46e900339e78214ee363

Modified Files
--------------
src/backend/utils/adt/jsonfuncs.c | 11 ++++++-----
src/test/regress/expected/sqljson_queryfuncs.out | 15 +++++++++++++++
src/test/regress/sql/sqljson_queryfuncs.sql | 5 +++++
3 files changed, 26 insertions(+), 5 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-07-26 09:19:30 pgsql: Disable all TLS session tickets
Previous Message Amit Langote 2024-07-26 07:43:29 pgsql: SQL/JSON: Improve error-handling of JsonBehavior expressions