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

From A. Kretschmer
Subject Re: Accessing array elements in a FOR PL/pgsql loop
Date
Msg-id 20090219105032.GD8766@a-kretschmer.de
Whole thread Raw
In response to Accessing array elements in a FOR PL/pgsql loop  (Igor Katson <descentspb@gmail.com>)
Responses Re: Accessing array elements in a FOR PL/pgsql loop
List pgsql-general
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
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: When adding millions of rows at once, getting out of disk space errors
Next
From: Mike Christensen
Date:
Subject: Re: When adding millions of rows at once, getting out of disk space errors