> This problem annoys me, if I have more than several hundred function
> which returns different result set, like contains foreign keys,
> I have to create many type for function's return.
>
> Can plpgsql returns result set according to what exactly fetched,
> then take return type as references to store data for return.
>
> Whether there is some better way to deal with this problem?
Yeah, you just make your function return 'SETOF record' and specify the
types when you do the select:
select * from func() as (a int, b text);
Chris