How do I return a result set? Is there a better way in 'plpgsql' than the one described below? I do not want to make a select from a function(which pretty useful in many cases): SELECT * FROM getfoo(); , but I want to just call the function with SELECT getfoo();
--DROPFUNCTION getfoo(); --DROP type compfoo;
CREATE TYPE compfoo AS(f1 integer,f2 integer);
CREATEORREPLACEFUNCTION getfoo() RETURNS SETOF compfoo AS $BODY$ declare ret_row record; BEGIN