BUG #8399: inconsistent input of multidimensional arrays - Mailing list pgsql-bugs

From borz_off@cs.msu.su
Subject BUG #8399: inconsistent input of multidimensional arrays
Date
Msg-id E1VEETa-0007KM-8O@wrigleys.postgresql.org
Whole thread Raw
Responses Re: BUG #8399: inconsistent input of multidimensional arrays
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      8399
Logged by:          Alexey Borzov
Email address:      borz_off@cs.msu.su
PostgreSQL version: 9.3rc1
Operating system:   irrelevant
Description:

PostgreSQL documentation states:


"Multidimensional arrays must have matching extents for each dimension. A
mismatch causes an error..."


This is not completely true:
postgres=# select cast('{{1,2}, {3}}' as integer[]);
ERROR:  multidimensional arrays must have array expressions with matching
dimensions
LINE 1: select cast('{{1,2}, {3}}' as integer[]);
                    ^
postgres=# select cast('{{1}, {2,3}}' as integer[]);
       int4
------------------
 {{1,NULL},{2,3}}
(1 row)


Trying to use an array constructor yields an expected error in both cases.


Confirmed on 9.3rc1 and 9.0.13

pgsql-bugs by date:

Previous
From: martin.kevin@gmail.com
Date:
Subject: BUG #8398: to_json(''::hstore) gives invalid JSON
Next
From: borz_off@cs.msu.su
Date:
Subject: BUG #8401: weird input accepted for intervals and geometric types