Эти функции эквивалентны:
create type my_type as (id int, str text);
create or replace function function_returning_setof(n int)
returns setof my_type language sql as $$
select i, i::text
from generate_series(1, n) i;
$$;
create or replace function function_returning_table(n int)
returns table(id int, str text) language sql as $$
select i, i::text
from generate_series(1, n) i;
$$;
create or replace function function_with_out_params(in n int, out id int, out str text)
returns setof record language sql as $$
select i, i::text
from generate_series(1, n) i;
$$;
DbFiddle.