SQL/JSON: Respect OMIT QUOTES when RETURNING domains over jsonb
authorAmit Langote <[email protected]>
Fri, 26 Jul 2024 07:08:13 +0000 (16:08 +0900)
committerAmit Langote <[email protected]>
Fri, 26 Jul 2024 07:36:10 +0000 (16:36 +0900)
commit3c3ccd4ca80136939abf97a7c19b67486dfda3af
treef904c2d24c6870deec2d88fbf1f411972ed04bfa
parentd1dc4ae5608d9c0e83d5b5d32de238a7ac3d9a1a
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 <[email protected]>
Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com
Backpatch-through: 17
src/backend/utils/adt/jsonfuncs.c
src/test/regress/expected/sqljson_queryfuncs.out
src/test/regress/sql/sqljson_queryfuncs.sql