Search Postgresql Archives

array_to_set functions

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

 



David Fetter and I just came up with these, perhaps others will find
them useful:

CREATE OR REPLACE FUNCTION array_to_set(anyarray, int) RETURNS SETOF anyelement LANGUAGE SQL AS $$
    SELECT $1[i] from generate_series(array_lower($1, $2), array_upper($1, $2)) i
$$;
CREATE OR REPLACE FUNCTION array_to_set(anyarray) RETURNS SETOF anyelement LANGUAGE SQL AS $$
    SELECT array_to_set($1, 1)
$$;
-- 
Decibel!, aka Jim Nasby                        decibel@xxxxxxxxxxx
EnterpriseDB      http://enterprisedb.com      512.569.9461 (cell)

Attachment: pgpJiGIMI6VUr.pgp
Description: PGP signature


[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