> Really?
>
> FOR var IN SELECT UNNEST(arr) LOOP ... END LOOP
>
> I mean, doing everything is sort of clunky in PL/pgsql, but this
> doesn't seem particularly bad as PL/pgsql idioms go.
>
this simple construction can take much more memory than other. I
proposed two or three years ago FOREACH statement
FOREACH var IN array LOOP END LOOP
this statement can be implemented very efective - and I think it can
be joined to some form of string_to_array function, because var
specify target element type.
FOREACH var IN parse('....',...) LOOP END LOOP
Regards
Pavel Stehule