Re: [GENERAL] Question regarding new windowing functions in 8.4devel

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [GENERAL] Question regarding new windowing functions in 8.4devel
Дата
Msg-id 8928.1232129126@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [GENERAL] Question regarding new windowing functions in 8.4devel  (David Fetter <david@fetter.org>)
Список pgsql-hackers
David Fetter <david@fetter.org> writes:
> Basically, there is no way I've found so far to qualify any window
> function in the target list, which makes a giant POLA violation.

The FM points out in at least two places that window functions logically
execute on the output of the WHERE/GROUP BY/HAVING steps.   It's
conceptually nonsensical to have window function calls in those clauses,
just like it's conceptually nonsensical to use aggregates in WHERE.

Therefore, if you need to filter on the results of the window functions,
you put them into a sub-select and write the filter condition in the
outer query.  This is required by spec, and it really does not matter
whether you find it astonishing.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: FATAL: could not open relation pg_tblspc/491086/467369/491103: No such file or directory
Следующее
От: Tom Lane
Дата:
Сообщение: Re: FWD: Re: Updated backslash consistency patch