Re: Converting each item in array to a query result row - Mailing list pgsql-general

From Grzegorz Jaśkiewicz
Subject Re: Converting each item in array to a query result row
Date
Msg-id 2f4958ff0905290355g6a1216b2s154a883a25c9445f@mail.gmail.com
Whole thread Raw
In response to Re: Converting each item in array to a query result row  (Adam Ruth <adamruth@mac.com>)
Responses Re: Converting each item in array to a query result row
List pgsql-general
why complicate so much ? this is a single sql query. It really shocks
me, how people easily lean on plpgsql and for/loops - which are times
slower than simple sql query:

CREATE FUNCTION unnest(anyarray) RETURNS SETOF anyelement AS
$_$
 SELECT ($1)[i] FROM generate_series(array_lower($1,1),array_upper($1,1)) i;
$_$
    LANGUAGE sql IMMUTABLE;

pgsql-general by date:

Previous
From: Geoffrey
Date:
Subject: Re: Please remove me from the list!
Next
From: Nico Sabbi
Date:
Subject: Re: I can't drop a user if I don't drop his grants beforehand??????????????????