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

Amit Langote <amitlan@postgresql.org>

Commit: 4fc6a555606de003690d46e900339e78214ee363
Author: Amit Langote <amitlan@postgresql.org>
Date: 2024-07-26T07:08:13Z
Releases: 18.0
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.universality@gmail.com>
Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com
Backpatch-through: 17

Files

Discussion