"Joel Jacobson" writes:
> On Sat, Dec 19, 2020, at 21:35, Tom Lane wrote:
>> Here is a proposed patch for that.
> In addition, to the user wondering how to append a json array-value "as is",
> I think it would be useful to provide an example on how to do this
> in the documentation.
Done in v13
Hi,
w.r.t. the patch,
+select '[3]'::jsonb || '{}'::jsonb;
+ ?column?
+--
+ [3, {}]
+(1 row)
+
+select '3'::jsonb || '[]'::jsonb;
Should cases where the empty array precedes non-empty jsonb be added ?
select '[]'::jsonb || '3'::jsonb;
select '{}'::jsonb || '[3]'::jsonb;
Cheers
On Sat, Dec 19, 2020, at 21:35, Tom Lane wrote:
>Here is a proposed patch for that.
I've tested the patch and "All 202 tests passed".
In addition, I've tested it on a json intensive project,
which passes all its own tests.
I haven't studied the jsonfuncs.c code in detail,
but the new code looks
so 19. 12. 2020 v 21:35 odesÃlatel Tom Lane napsal:
> I wrote:
> > However, further experimentation found a case that fails:
> > regression=# select '3'::jsonb || '{}'::jsonb;
> > ERROR: invalid concatenation of jsonb objects
> > I wonder what is the point of this weird exception, and whether
>
I wrote:
> However, further experimentation found a case that fails:
> regression=# select '3'::jsonb || '{}'::jsonb;
> ERROR: invalid concatenation of jsonb objects
> I wonder what is the point of this weird exception, and whether
> whoever devised it can provide a concise explanation of what
> t
The discussion in [1] pointed out that the existing documentation
for the "jsonb || jsonb" concatenation operator is far short of
reality: it fails to acknowledge that the operator will accept
any cases other than two jsonb array inputs or two jsonb object
inputs.
I'd about concluded that other ca