Hello
I reread a discus to this topic. It's look like we can to find a
agreement on following syntax:
FOREACH var [,var [..]] [SLICE number] IN expr
LOOP
END LOOP;
In default mode, without keyword SLICE, it will iterate over every
field like "unnest" does. With SLICE keyword, it iterate over nested
arrays. Deep can be chosen. I don't see a reason why the deep should
be a dynamic. There can be a constant.
variable list is used only when item is record or row type.
I am not sure what is better keyword - SLICE or SLICING ?
Regards
Pavel Stehule