unnest on multi-dimensional arrays

Started by Zev Benjaminover 12 years ago1 messagesgeneral
Jump to latest
#1Zev Benjamin
zev@strangersgate.com

It appears that unnest, when called on a multi-dimensional array,
effectively flattens the array first. For example:

=> select * from unnest(array[array[1, 2], array[2, 3]]);
unnest
--------
1
2
2
3
(4 rows)

while I would have expect something like the following:

=> select * from unnest(array[array[1, 2], array[2, 3]]);
unnest
--------
{1, 2}
{2, 3}
(2 rows)

Is there any way to get the latter behavior?

Zev

--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general