Paste this into a new question or an answer at dba.stackexchange.com:
<!-- --> > CREATE OR REPLACE FUNCTION f_test() > RETURNS SETOF int AS > $func$ > BEGIN > RETURN QUERY SELECT 1; > RETURN QUERY SELECT 2; > END > $func$ LANGUAGE plpgsql; > > <pre> > ✓ > </pre> <!-- --> > SELECT * FROM f_test(); > > <pre> > | f_test | > | -----: | > | 1 | > | 2 | > </pre> *db<>fiddle [here](https://dbfiddle.uk/?rdbms=postgres_9.6&fiddle=28aae0139d521a01c26e748234fe178a)*
back to fiddle