]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Improve the error message given for modifying a window with frame clause.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 6 Nov 2013 02:58:19 +0000 (21:58 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 6 Nov 2013 02:58:19 +0000 (21:58 -0500)
commitdb157fb141df983f6d66209182ef4ac7997588d4
tree3e89b6ed32d45371e06fb3982410eca83115e678
parent4c412ca2e510ecde00e36d226ff933acd6fb477a
Improve the error message given for modifying a window with frame clause.

For rather inscrutable reasons, SQL:2008 disallows copying-and-modifying a
window definition that has any explicit framing clause.  The error message
we gave for this only made sense if the referencing window definition
itself contains an explicit framing clause, which it might well not.
Moreover, in the context of an OVER clause it's not exactly obvious that
"OVER (windowname)" implies copy-and-modify while "OVER windowname" does
not.  This has led to multiple complaints, eg bug #5199 from Iliya
Krapchatov.  Change to a hopefully more intelligible error message, and
in the case where we have just "OVER (windowname)", add a HINT suggesting
that omitting the parentheses will fix it.  Also improve the related
documentation.  Back-patch to all supported branches.
doc/src/sgml/syntax.sgml
src/backend/parser/parse_clause.c