pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Joel Jacobson <joel@compiler.org>
Cc: pgsql-general <pgsql-general@postgresql.org>
Subject: Re: Avoid undesired flattening of jsonb arrays?
Date: Fri, 18 Dec 2020 11:20:34 -0500
Message-ID: <160622.1608308434@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYAjzoDtUdXz03K-Cs8UDG9TKkdQLRAWAxFc2kGwMr0_A@mail.gmail.com>
References: <0d72b76d-ca2b-4263-8888-d6dfca861c51@www.fastmail.com>
	<CAKFQuwYAjzoDtUdXz03K-Cs8UDG9TKkdQLRAWAxFc2kGwMr0_A@mail.gmail.com>

"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





view thread (4+ messages)  latest in thread

Message-ID: <160622.1608308434@sss.pgh.pa.us>
Permalink:  ../160622.1608308434@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/160622.1608308434@sss.pgh.pa.us

 · 

reply

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-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, joel@compiler.org
  Subject: Re: Avoid undesired flattening of jsonb arrays?
  In-Reply-To: <160622.1608308434@sss.pgh.pa.us>
  References: <0d72b76d-ca2b-4263-8888-d6dfca861c51@www.fastmail.com> <CAKFQuwYAjzoDtUdXz03K-Cs8UDG9TKkdQLRAWAxFc2kGwMr0_A@mail.gmail.com> <160622.1608308434@sss.pgh.pa.us>

* 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