The following bug has been logged online:
Bug reference: 5018
Logged by: Marko Tiikkaja
Email address: marko.tiikkaja@cs.helsinki.fi
PostgreSQL version: 8.4.0
Operating system: Linux
Description: Window function alias
Details:
I came across this:
=> SELECT lead(foo) OVER(ORDER BY foo) AS foo FROM (VALUES(0)) bar(foo);
ERROR: window functions not allowed in window definition
Changing the *column alias* to something else gives the expected answer. Is
this really the desired behaviour?