I've now seen the 'unnest' function defined in a few different ways with
regard to aliases.
Substitute the following pairs of values for X and Y in the query below,
and all of them work (in PG 8.3.6, at least):
X Y
g g
i g(i)
g g(i)
g.i g(i)
create or replace function unnest(anyarray)
returns setof anyelement as $$
select $1[X] from generate_series(array_lower($1,1),array_upper($1,1)) Y;
$$ language sql;
Please enlighten the unworthy!
Thanks,
Kevin Murphy
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general