On Thu, 19 Feb 2009, Igor Katson wrote:
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.
there is, but in CVS HEAD
psql (8.4devel)
Type "help" for help.
postgres=# select unnest('{1,2,3}'::int[]);
unnest
--------
1
2
3
(3 rows)
Regards,
Oleg
_____________________________________________________________
Oleg Bartunov, Research Scientist, Head of AstroNet (www.astronet.ru),
Sternberg Astronomical Institute, Moscow University, Russia
Internet: oleg@xxxxxxxxxx, http://www.sai.msu.su/~megera/
phone: +007(495)939-16-83, +007(495)939-23-83
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general