Re: Array dimension lost if dimension length is zero

From: Shay Rojansky <roji(at)roji(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Array dimension lost if dimension length is zero
Date: 2016-09-08 19:31:38
Message-ID: CADT4RqDZ2+MfHC-bQ86cG1-q+=c_6Gt9BZoXME6+B9h=cw6XzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Ah, I see. And changing this in a major version is out of the question? It
makes dealing with arrays more complicated than it should be on the client
side etc.

On Thu, Sep 8, 2016 at 5:32 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:

> Shay Rojansky <roji(at)roji(dot)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
>

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message soufiane.boussali 2016-09-08 21:29:03 BUG #14318: remote blind SQL injection vulnerability
Previous Message Tom Lane 2016-09-08 17:32:02 Re: Array dimension lost if dimension length is zero