pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Dunstan <andrew@dunslane.net>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: RETURNING clause for JSON() and JSON_SCALAR()
Date: Thu, 31 Mar 2022 19:45:44 +0000
Message-ID: <E1na0jn-000COS-SU@gemulon.postgresql.org> (raw)

RETURNING clause for JSON() and JSON_SCALAR()

This patch is extracted from a larger patch that allowed setting the
default returned value from these functions to json or jsonb. That had
problems, but this piece of it is fine. For these functions only json or
jsonb can be specified in the RETURNING clause.

Extracted from an original patch from Nikita Glukhov

Reviewers have included (in no particular order) Andres Freund, Alexander
Korotkov, Pavel Stehule, Andrew Alsup, Erik Rijkers, Zihong Yu,
Himanshu Upadhyaya, Daniel Gustafsson, Justin Pryzby.

Discussion: https://postgr.es/m/cd0bb935-0158-78a7-08b5-904886deac4b@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/49082c2cc3d8167cca70cfe697afb064710828ca

Modified Files
--------------
src/backend/nodes/copyfuncs.c         |  2 ++
src/backend/nodes/equalfuncs.c        |  2 ++
src/backend/nodes/nodeFuncs.c         | 20 ++++++++++--
src/backend/parser/gram.y             |  7 +++--
src/backend/parser/parse_expr.c       | 46 ++++++++++++++++++++++------
src/backend/utils/adt/ruleutils.c     |  5 +--
src/include/nodes/parsenodes.h        |  2 ++
src/test/regress/expected/sqljson.out | 57 +++++++++++++++++++++++++++++++++++
src/test/regress/sql/sqljson.sql      | 10 ++++++
9 files changed, 135 insertions(+), 16 deletions(-)



Message-ID: <E1na0jn-000COS-SU@gemulon.postgresql.org>
Permalink:  ../E1na0jn-000COS-SU@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1na0jn-000COS-SU@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: andrew@dunslane.net
  Subject: Re: pgsql: RETURNING clause for JSON() and JSON_SCALAR()
  In-Reply-To: <E1na0jn-000COS-SU@gemulon.postgresql.org>
  References: <E1na0jn-000COS-SU@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox