Re: Accessing array elements in a FOR PL/pgsql loop - Mailing list pgsql-general

From Igor Katson
Subject Re: Accessing array elements in a FOR PL/pgsql loop
Date
Msg-id 499D4200.2080709@gmail.com
Whole thread Raw
In response to Re: Accessing array elements in a FOR PL/pgsql loop  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Responses Re: Accessing array elements in a FOR PL/pgsql loop
List pgsql-general
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.

pgsql-general by date:

Previous
From: Howard Cole
Date:
Subject: Re: Pet Peeves?
Next
From: Jasen Betts
Date:
Subject: Re: Appending \o output instead of overwriting the output file