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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: non-deterministic error related to MIN/MAX optimization
Дата
Msg-id 22280.1220831886@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: non-deterministic error related to MIN/MAX optimization  ("Pavel Stehule" <pavel.stehule@gmail.com>)
Список pgsql-bugs
[ back to this issue ]

"Pavel Stehule" <pavel.stehule@gmail.com> writes:
> 2008/8/26 Tom Lane <tgl@sss.pgh.pa.us>:
>> Jeff Davis <pgsql@j-davis.com> writes:
>>> ERROR:  set-valued function called in context that cannot accept a set
>>
>> 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.

> I dislike this feature - sometime we can do nice hack with it, but
> it's very dificult readable.

I think the plan has been to implement SQL's LATERAL feature and then
deprecate SRFs-in-targetlist.  However, I don't see anyone working on
LATERAL for 8.4, and even if it did happen for 8.4, it would be a long
time after that before we could consider removing SRFs-in-targetlist
support altogether.  (Besides, is LATERAL really so much more readable?)
In the meantime we have a bug or at least a functionality gap here.

So I'm thinking that we ought to fix nodeAgg and nodeGroup to support
this.  It doesn't look like it will really take much extra code.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #4410: Indexes not seen right away
Следующее
От: Craig Ringer
Дата:
Сообщение: Re: BUG #4409: postmaster service is stopped