Re: Array dimension lost if dimension length is zero

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shay Rojansky <roji(at)roji(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Array dimension lost if dimension length is zero
Date: 2016-09-08 17:32:02
Message-ID: 19962.1473355922@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Shay Rojansky 2016-09-08 19:31:38 Re: Array dimension lost if dimension length is zero
Previous Message Shay Rojansky 2016-09-08 17:25:11 Array dimension lost if dimension length is zero