Heikki Linnakangas <heikki.linnakangas@enterprisedb.com> writes:
> Try without the parenthesis in OVER:
> ...
> I'm quite surprised by the error message that produces, though...
It's actually correct: the syntax with parens specifies copying
and modifying the named WINDOW definition, but you're not allowed to
copy-and-modify a definition that has a FRAME clause. (Why the spec
says that is beyond me; replacing the FRAME clause seems sensible
enough, but ...)
This isn't terribly well explained in our docs, as far as I can
find at the moment. The SELECT reference page mentions the rule
in the context of a dependent WINDOW-clause definition, but
doesn't explain that OVER with parens acts the same way.
And maybe the error message wording could be improved.
regards, tom lane