unnest on multi-dimensional arrays - Mailing list pgsql-general

From Zev Benjamin
Subject unnest on multi-dimensional arrays
Date
Msg-id 5296EB60.2010103@strangersgate.com
Whole thread Raw
Responses Re: unnest on multi-dimensional arrays
Re: unnest on multi-dimensional arrays
List pgsql-general
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


pgsql-general by date:

Previous
From: Albert Chern
Date:
Subject: Prefix search on all hstore values
Next
From: Pavel Stehule
Date:
Subject: Re: unnest on multi-dimensional arrays