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: Only allow returning string types or bytea from json_serialize
Date: Thu, 07 Jul 2022 21:46:12 +0000
Message-ID: <E1o9ZK7-001hMM-5M@gemulon.postgresql.org> (raw)

Only allow returning string types or bytea from json_serialize

These are documented to be the allowed types for the RETURNING clause,
but the restriction was not being enforced, which caused a segfault if
another type was specified. Add some testing for this.

Per report from a.kozhemyakin

Backpatch to release 15.

Branch
------
REL_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2b2bcc22e571c27a9ea8861e29e0c40874dae714

Modified Files
--------------
src/backend/parser/parse_expr.c       | 17 +++++++++++++++++
src/test/regress/expected/sqljson.out | 10 ++++++++++
src/test/regress/sql/sqljson.sql      |  5 +++++
3 files changed, 32 insertions(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1o9ZK7-001hMM-5M@gemulon.postgresql.org>
Permalink:  ../E1o9ZK7-001hMM-5M@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1o9ZK7-001hMM-5M@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: Only allow returning string types or bytea from json_serialize
  In-Reply-To: <E1o9ZK7-001hMM-5M@gemulon.postgresql.org>
  References: <E1o9ZK7-001hMM-5M@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