Hello! This a test sample:
CREATE TABLE _testdbf (fooid int, foosubid int, fooname text);
INSERT INTO _testdbf VALUES (1, 1, 'Joe');
INSERT INTO _testdbf VALUES (1, 2, 'Ed');
INSERT INTO _testdbf VALUES (2, 1, 'Mary');
CREATE FUNCTION _test(int,int,int,int) RETURNS SETOF _testdbf AS $$...