pgsql: Improve the error message given for modifying a window with fram - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Improve the error message given for modifying a window with fram
Date
Msg-id E1VdtKj-0004D6-9d@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
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.

Branch
------
REL8_4_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/2268d1c14c08e3c967c9374784638139458fe49a

Modified Files
--------------
doc/src/sgml/syntax.sgml          |   20 ++++++++++----------
src/backend/parser/parse_clause.c |   31 ++++++++++++++++++++++++++-----
2 files changed, 36 insertions(+), 15 deletions(-)


pgsql-committers by date:

Previous
From: Tom Lane
Date:
Subject: pgsql: Revert commit 0725065b37b8b0e9074a624a8d3e3ac1844fc820.
Next
From: Tom Lane
Date:
Subject: pgsql: Improve the error message given for modifying a window with fram