Re: RETURNS TABLE returns NULL set when called by another RETURNS TABLE

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: RETURNS TABLE returns NULL set when called by another RETURNS TABLE
Дата
Msg-id 23517.1266982478@sss.pgh.pa.us
обсуждение исходный текст
Ответ на RETURNS TABLE returns NULL set when called by another RETURNS TABLE  (Josh Berkus <josh@agliodbs.com>)
Ответы Re: RETURNS TABLE returns NULL set when called by another RETURNS TABLE
Список pgsql-bugs
Josh Berkus <josh@agliodbs.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

В списке pgsql-bugs по дате отправления:

Предыдущее
От: Josh Berkus
Дата:
Сообщение: RETURNS TABLE returns NULL set when called by another RETURNS TABLE
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: RETURNS TABLE returns NULL set when called by another RETURNS TABLE