For each element in the array, I need to make some operation with plpgsql.
I usually use the syntax:
DECLARE
array_len int;
BEGIN
array_len := array_upper(i_array, 1);
FOR i IN 1 .. array_len
LOOP
SOME OPERATION (i_array[i])
END LOOP;
But I don't like that. Is there any built-in way to do that without
using the length, i.e like in python, e.g.
for element in array:
....
This example does not work in Postgres.
I think I need a built-in function to make a column from an array, like
in the backwards operation SELECT ARRAY(column)
--
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general