Re: BUG #5199: Window frame clause wrong (?) behaviour - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #5199: Window frame clause wrong (?) behaviour
Date
Msg-id 28470.1258660509@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #5199: Window frame clause wrong (?) behaviour  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
List pgsql-bugs
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

pgsql-bugs by date:

Previous
From: "Orange"
Date:
Subject: data shown from down to up
Next
From: Jaime Casanova
Date:
Subject: Re: data shown from down to up