Re: RETURNS TABLE function returns nothingness

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: RETURNS TABLE function returns nothingness
Дата
Msg-id 23454.1472838307@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: RETURNS TABLE function returns nothingness  (Alexander Farber <alexander.farber@gmail.com>)
Список pgsql-general
Alexander Farber <alexander.farber@gmail.com> writes:
> If I'd like to always return exactly 1 row -
> why wouldn't just RETURN work?

Because RETURNS TABLE means it's RETURNS SETOF something,
which means the number of rows it produces is equal to the
number of RETURN NEXTs executed.  RETURN, per se, has exactly
zero impact on the number of rows produced; it just stops execution.

I think you can say RETURNS RECORD with a few OUT parameters
to get the effect you're looking for.

            regards, tom lane


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: RETURNS TABLE function returns nothingness
Следующее
От: Benoit Lobréau
Дата:
Сообщение: PGDATA / data_directory