Re: Set returning functions in the SELECT list

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Set returning functions in the SELECT list
Дата
Msg-id 14872.1353079872@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Set returning functions in the SELECT list  (Ryan Kelly <rpkelly22@gmail.com>)
Список pgsql-general
Ryan Kelly <rpkelly22@gmail.com> writes:
> I have a question about the behavior of SRFs in the SELECT list.

If you have more than one in a select list, the number of resulting rows
is the least common multiple of their periods, because the select list
gets cycled until they all terminate at the same time.

> Also, I'm not sure where this difference in behavior is
> documented.

AFAIK it's not documented.  Every time it comes up there are arguments
about whether to change it, and nobody has wanted to make a permanent
commitment to this behavior by documenting it.  (On the other hand,
since it's been like this since Berkeley days, it would be pretty hard
to make an adequate case for changing it and likely breaking
applications ...)

> And yes, I understand doing this is deprecated and my results would
> probably be better achieved with LATERAL when 9.3 comes out.

Yeah, LATERAL has a lot less semantic messiness to it.

            regards, tom lane


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: High SYS CPU - need advise
Следующее
От: Vlad
Дата:
Сообщение: Re: High SYS CPU - need advise