Search Postgresql Archives

Aliasing syntax question

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

 



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

[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