Re: Reason why set-value functions not allowed in GREATEST(), etc?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Reason why set-value functions not allowed in GREATEST(), etc?
Дата
Msg-id 701.1266870294@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Reason why set-value functions not allowed in GREATEST(), etc?  (Hitoshi Harada <umi.tanuki@gmail.com>)
Список pgsql-hackers
Hitoshi Harada <umi.tanuki@gmail.com> writes:
> I just wonder why generate_series() is not allowed in GREATEST syntax.
> Looking through execQual.c,  almost all syntactic evaluations like
> COALESCE, ARRAY[], ROW() doesn't allow set-value functions. Could
> someone tell the underlying reason?

Laziness, or lack of return for the effort, or lack of desire to extend
a semantically dubious behavior even further, as you prefer.

You could support at most one set-returning input (at least without an
order of magnitude increase in complexity and creating even more room
for semantic debate), and keeping track of which one is the set would be
a PITA.  Essentially you'd need to add something of about the complexity
of ExecTargetList() to each one of those special purpose functions.

The other reason is that a lot of us think that SRFs in the targetlist
are not a feature we want to encourage anyway.  The semantics are either
dubious or outright broken depending on who you ask.  And from a
performance standpoint, adding any more complexity to execQual nodes is
not a sane thing to be doing.  What we ought to do is implement LATERAL
and tell people to move in that direction.
        regards, tom lane


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

Предыдущее
От: Merlin Moncure
Дата:
Сообщение: Re: scheduler in core
Следующее
От: Tom Lane
Дата:
Сообщение: Re: What does this configure warning mean?