Re: BUG #5872: Function call in SQL function executed only once

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #5872: Function call in SQL function executed only once
Дата
Msg-id 10793.1297205346@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #5872: Function call in SQL function executed only once  ("Rodolfo Campero" <rodolfo.campero@anachronics.com>)
Список pgsql-bugs
"Rodolfo Campero" <rodolfo.campero@anachronics.com> writes:
> I stumbled upon a weird behavior of postgresql, I don't know if it's a bug
> or not, but I find it counterintuitive: when then last statement of a SQL
> function is a SELECT statement with calls another function, the call is
> executed only once, regardless of the number of rows returned by the FROM
> clause.

Yeah, it stops as soon as it's got the one row needed for the function
result.  You might consider marking the function as returning SETOF if
you want the final select executed to completion.

            regards, tom lane

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

Предыдущее
От: "Rodolfo Campero"
Дата:
Сообщение: BUG #5872: Function call in SQL function executed only once
Следующее
От: Fujii Masao
Дата:
Сообщение: Re: BUG #5851: ROHS (read only hot standby) needs to be restarted manually in somecases.