Re: Avoid undesired flattening of jsonb arrays? - Mailing list pgsql-general

From Tom Lane
Subject Re: Avoid undesired flattening of jsonb arrays?
Date
Msg-id 160622.1608308434@sss.pgh.pa.us
Whole thread Raw
In response to Re: Avoid undesired flattening of jsonb arrays?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Responses Re: Avoid undesired flattening of jsonb arrays?  ("Joel Jacobson" <joel@compiler.org>)
List pgsql-general
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> I'll agree that the description could discuss the case explicitly, and the
> array||scalar case could be added to the examples.

Yeah, the documentation completely fails to explain what happens
when the inputs aren't two arrays or two objects.  I'd kind of assumed
that that's an error, but it isn't.  Some experimentation indicates
that the behavior in all cases except two objects is to convert any
non-array input to a one-element array, reducing the situation to the
two-array case.

            regards, tom lane



pgsql-general by date:

Previous
From: Lars Vonk
Date:
Subject: Missing rows after migrating from postgres 11 to 12 with logical replication
Next
From: "Joel Jacobson"
Date:
Subject: Re: Avoid undesired flattening of jsonb arrays?