]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Remove "invalid concatenation of jsonb objects" error case.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 21 Dec 2020 18:11:30 +0000 (13:11 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 21 Dec 2020 18:11:30 +0000 (13:11 -0500)
commit542248f9ddfd49f268b2edc4b6beeff7cf0b6aba
tree3d5fd5f32fed69521fe5a08d229592f8075f755c
parentefaeabcc1c37d0908ddc6e868a64e1293817ad0f
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
doc/src/sgml/func.sgml
src/backend/utils/adt/jsonfuncs.c
src/test/regress/expected/jsonb.out
src/test/regress/sql/jsonb.sql