Loop over array dimension in plpgsql
Since PostgreSQL 9.1 There is the convenient FOREACH which can loop over slices of arrays. The manual: The target variable must be an array, and it receives successive slices of the array value, where each slice is of the number of dimensions specified by SLICE. DO $do$ DECLARE m text[]; arr text[] := ‘{{key1,val1},{key2,val2}}’; — … Read more