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-001hML-4h@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
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/3c633f32b9c712cc0b4c8d946f0eeae04a3ff51a
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(+)
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-001hML-4h@gemulon.postgresql.org>
References: <E1o9ZK7-001hML-4h@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