Re: WITHIN GROUP patch

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: WITHIN GROUP patch
Дата
Msg-id 22969.1386454566@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: WITHIN GROUP patch  (Andrew Gierth <andrew@tao11.riddles.org.uk>)
Ответы Re: WITHIN GROUP patch
Список pgsql-hackers
Andrew Gierth <andrew@tao11.riddles.org.uk> writes:
> "Tom" == Tom Lane <tgl@sss.pgh.pa.us> writes:
>  Tom> After examining this more closely, ISTM that the direct
>  Tom> arguments are supposed to be processed as if they weren't inside
>  Tom> an aggregate call at all.  That being the case, isn't it flat
>  Tom> out wrong for check_agg_arguments() to be examining the
>  Tom> agg_ordset list?  It should ignore those expressions whilst
>  Tom> determining the aggregate's semantic level.  As an example, an
>  Tom> upper-level Var in those expressions isn't grounds for deciding
>  Tom> that the aggregate isn't of the current query level.

> Hmm... yes, you're probably right; but we'd still have to check somewhere
> for improper nesting, no? since not even the direct args are allowed to
> contain nested aggregate calls.

Yeah, I had come to that same conclusion while making the changes;
actually, check_agg_arguments needs to look for aggs but not vars there.

In principle we could probably support aggs there if we really wanted to;
but it would result in evaluation-order dependencies among the aggs of a
single query level, which doesn't seem like something we want to take on
for a feature that's not required by spec.
        regards, tom lane



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

Предыдущее
От: Pavel Stehule
Дата:
Сообщение: Re: plpgsql_check_function - rebase for 9.3
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Extension Templates S03E11