Search Postgresql Archives

Re: different unnest function [SOLVED]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

> to get the output OP wants, you need to expand and rewrap:
> create or replace function unnest2(anyarray) returns setof anyarray AS
> $BODY$
> select array(select unnest($1[i:i])) from
> generate_series(array_lower($1,1), array_upper($1,1)) i;
> $BODY$
> language 'sql';

Yup, this is what I need. Thanks


-- 
Ondrej Ivanic
(ondrej.ivanic@xxxxxxxxx)

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


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux