Hi Everyone,
Does anyone know if/how it's possible to return multi-column sets from a pgsql
function? Right now I'm using something like the following as a work around
CREATE OR REPLACE FUNCTION my_func() returns SETOF TEXT AS '
DECLARE
rec record;
BEGIN
FOR rec IN SELECT txt1, txt2 FROM mytable LOOP
RETURN NEXT rec.txt1;
RETURN NEXT rec.txt2;
END LOOP;
RETURN;
END;' language 'plpgsql';
which leaves me parsing multiple records to achieve the desired end result.
Anyone have any thoughts?
Thanks,
Mark