On 16th of February, Tom Lane committed patch: Add FOREACH IN ARRAY looping to plpgsql.   (I'm not entirely sure that we've finished bikeshedding the syntax details, but the functionality seems OK.)   Pavel Stehule, reviewed by Stephen Frost and Tom Lane

Yesterday, Alvaro Herrera committed patch written by Pavel Stehule which adds generate_subscripts(...) function.