BUG #2212: Extracting array from 2 dim array may be incorrect - Mailing list pgsql-bugs

From Walter Roeland
Subject BUG #2212: Extracting array from 2 dim array may be incorrect
Date
Msg-id 20060126033856.43745F0A2F@svr2.postgresql.org
Whole thread Raw
Responses Re: BUG #2212: Extracting array from 2 dim array may be incorrect
List pgsql-bugs
The following bug has been logged online:

Bug reference:      2212
Logged by:          Walter Roeland
Email address:      wroeland@marcatel.net
PostgreSQL version: 8.1.2
Operating system:   Windows XP professional
Description:        Extracting array from 2 dim array may be incorrect
Details:

Select (Array[5,8,1])[2] as E;
returns 8 (ok, dimension is lowerd from 1 to 0).

Select (Array[Array[3,2,2],Array[7,4,4],Array[5,8,1]])[3:3] as V;
returns {{5,8,1}} (I suppose this is ok, same dimension).

But:
Select (Array[Array[3,2,2],Array[7,4,4],Array[5,8,1]])[3] as V;
Returns Null, as far I understand it should return {5,8,1}, i.e. lowering
dimension from 2 to 1.

Note: the documentation is not specific about when extracting an element
lowers the dimension (eg. using [2]) and when not (e.g. using [2:2]).

pgsql-bugs by date:

Previous
From: "Ricardo Solanilla"
Date:
Subject: BUG #2210: an update query bug with a table but not with your backup
Next
From: "Tiago D. J."
Date:
Subject: BUG #2211: select (1::float-1::float)*(-1) = -0 ??