Re: non-deterministic error related to MIN/MAX optimization

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: non-deterministic error related to MIN/MAX optimization
Дата
Msg-id 12210.1219774798@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: non-deterministic error related to MIN/MAX optimization  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: non-deterministic error related to MIN/MAX optimization  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Список pgsql-bugs
Jeff Davis <pgsql@j-davis.com> writes:
> => -- make "foo" into a subquery and add a no-op
> => -- to prevent it from pulling up the subquery
> => select max(a), generate_series(1,2) as g from (select a as a from foo
> offset 0) dummy;
> ERROR:  set-valued function called in context that cannot accept a set

> So, although Dan's transformations were semantically correct, they ended
> up causing this regression failure.

> It doesn't have anything to do with the ORDER BY, so that part of my
> example was unnecessary.

Hmm ... after a bit of poking at it, the reason it's failing is that Agg
plan nodes don't support SRFs in their targetlists.  (Group nodes don't
either.)  Kind of interesting that no one ever complained about that
before ... although given that plpgsql SRFs don't work in targetlists
anyway, maybe it's been masked for common uses.

I'm not entirely sure if we should add SRF support to Agg/Group or just
write it off as being a deprecated feature anyhow.  Given the
definitional issues involved with multiple SRFs in the same targetlist,
putting more effort into the feature doesn't seem like a great
investment of time.

            regards, tom lane

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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: non-deterministic error related to MIN/MAX optimization
Следующее
От: "Pavel Stehule"
Дата:
Сообщение: Re: non-deterministic error related to MIN/MAX optimization