Search Postgresql Archives

Re: Accessing array elements in a FOR PL/pgsql loop

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

 



A. Kretschmer wrote:
In response to Igor Katson :
I think I need a built-in function to make a column from an array, like in the backwards operation SELECT ARRAY(column)

By David Fetter:

CREATE OR REPLACE FUNCTION unnest(ANYARRAY) RETURNS SETOF ANYELEMENT
LANGUAGE SQL AS $$SELECT $1[i] FROM
generate_series(array_lower($1,1),array_upper($1,1)) i;$$;

HTH, Andreas
Thanks. I thought, there is a built-in one for that.

--
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