Search Postgresql Archives

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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Fetter <david@xxxxxxxxxx> 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

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux