From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Remove "invalid concatenation of jsonb objects" error case.
Date: Mon, 21 Dec 2020 18:12:22 +0000
Message-ID: <E1krPfS-0005XF-BM@gemulon.postgresql.org> (raw)
Remove "invalid concatenation of jsonb objects" error case.
The jsonb || jsonb operator arbitrarily rejected certain combinations
of scalar and non-scalar inputs, while being willing to concatenate
other combinations. This was of course quite undocumented. Rather
than trying to document it, let's just remove the restriction,
creating a uniform rule that unless we are handling an object-to-object
concatenation, non-array inputs are converted to one-element arrays,
resulting in an array-to-array concatenation. (This does not change
the behavior for any case that didn't throw an error before.)
Per complaint from Joel Jacobson. Back-patch to all supported branches.
Discussion: https://postgr.es/m/163099.1608312033@sss.pgh.pa.us
Branch
------
REL_13_STABLE
Details
-------
https://git.postgresql.org/pg/commitdiff/38d30a14b05e0cc2996fd311d94d7ae4fe2122aa
Modified Files
--------------
doc/src/sgml/func.sgml | 22 +++++++++-
src/backend/utils/adt/jsonfuncs.c | 83 +++++++++++++++++--------------------
src/test/regress/expected/jsonb.out | 36 +++++++++++++++-
src/test/regress/sql/jsonb.sql | 5 +++
4 files changed, 99 insertions(+), 47 deletions(-)
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: tgl@sss.pgh.pa.us
Subject: Re: pgsql: Remove "invalid concatenation of jsonb objects" error case.
In-Reply-To: <E1krPfS-0005XF-BM@gemulon.postgresql.org>
References: <E1krPfS-0005XF-BM@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