I have the follwoing function which works fine, BUT I am not sure if it is storing anything in the array.
DECLARE
_r record;
point character varying[] := '{}';
i int := 0;
BEGIN
FOR _r IN EXECUTE ' SELECT a.'|| quote_ident(column_name) || ' AS point
FROM ' || quote_ident (table_name) ||' AS a'
LOOP
point[i] = _r;
i = i+1;
END LOOP;
RETURN point;
END;
What I am after is to have an array that from the javascript side i can traverse and read each value stored on the array. Is it the right way of doing it?