Josh Berkus <josh(at)agliodbs(dot)com> writes:
> Apparently if you use one returns table function to call a 2nd returns
> table function, it returns a recordset which consists entirely of nulls.
In HEAD that example fails with
psql:josh.sql:30: ERROR: column reference "id1" is ambiguous
LINE 1: select id1, val1 from srf1(1)
^
DETAIL: It could refer to either a PL/pgSQL variable or a table column.
QUERY: select id1, val1 from srf1(1)
CONTEXT: PL/pgSQL function "srf2" line 2 at RETURN QUERY
val1 is just as ambiguous. I think you got bit by the name collision;
the output parameters would start out NULLs and thus lead to the
described behavior, in versions before 9.0.
regards, tom lane