From: Tom Lane <tgl@sss.pgh.pa.us>
To: Shay Rojansky <roji@roji.org>
Cc: pgsql-bugs@postgresql.org
Subject: Re: Array dimension lost if dimension length is zero
Date: Thu, 08 Sep 2016 13:32:02 -0400
Message-ID: <19962.1473355922@sss.pgh.pa.us> (raw)
In-Reply-To: <CADT4RqDaXBuConyhNiPHPqASFxZWOFYYJsY_=DW03=+2H_-xwg@mail.gmail.com>
References: <CADT4RqDaXBuConyhNiPHPqASFxZWOFYYJsY_=DW03=+2H_-xwg@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>
Shay Rojansky <roji@roji.org> writes:
> An Npgsql user has reported an edge case use which seems to be a bug.
> When sending a multidimensional array to PostgreSQL, if the length of a
> dimension is 0, that dimension is lost. That is, the user sends a
> 2-dimensional array with 0 for both dimensions; trying to read this back
> will return a 1-dimensional array.
This is intentional: all empty arrays are alike, with zero dimensions
(not one dimension, but none).
Probably a lot of these decisions would be made differently if we were
starting over in a green field; but since we're not, I'm disinclined
to touch it.
regards, tom lane
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, roji@roji.org
Subject: Re: Array dimension lost if dimension length is zero
In-Reply-To: <19962.1473355922@sss.pgh.pa.us>
References: <CADT4RqDaXBuConyhNiPHPqASFxZWOFYYJsY_=DW03=+2H_-xwg@mail.gmail.com> <19962.1473355922@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