ARRAY[expr1, expr2, ...] Constructs a SQL ARRAY literal from the expression arguments, using the type of the first argument as the output array type. ARRAY_LENGTH(arr) Returns length of the array ...
WHILE COALESCE(array_length(a, 1), 0) < length(s) LOOP a[COALESCE(array_length(a, 1), 0) + 1] = substr(s, COALESCE(array_length(a, 1), 0) + 1, 1); ...