Re: Array dimension lost if dimension length is zero - Mailing list pgsql-bugs

From Tom Lane
Subject Re: Array dimension lost if dimension length is zero
Date
Msg-id 19962.1473355922@sss.pgh.pa.us
Whole thread Raw
In response to Array dimension lost if dimension length is zero  (Shay Rojansky <roji@roji.org>)
Responses Re: Array dimension lost if dimension length is zero  (Shay Rojansky <roji@roji.org>)
Re: Array dimension lost if dimension length is zero  (Shay Rojansky <roji@roji.org>)
List pgsql-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

pgsql-bugs by date:

Previous
From: Shay Rojansky
Date:
Subject: Array dimension lost if dimension length is zero
Next
From: Shay Rojansky
Date:
Subject: Re: Array dimension lost if dimension length is zero