Franco Bruno Borghesi wrote:
> ok, soy you're telling me that the only way to return a composite type is
> using a set of them, even if I know my function will allways return 1 record.
Try this:
create type foo as (f1 int, f2 text);
create or replace function retfoo(int, text) returns foo as '
declare
result foo%ROWTYPE;
begin
select into result $1, $2;
return result;
end;
' language 'plpgsql';
regression=# select * from retfoo(2,'b');
f1 | f2
----+----
2 | b
(1 row)
Joe