pgsql: Improve the error message given for modifying a window with fram

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Improve the error message given for modifying a window with fram
Date: 2013-11-06 02:59:04
Message-ID: E1VdtKi-0004Cq-Oq@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/920c8261d58c10de7e68d99c8dd21a9650928d59

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

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-11-06 02:59:05 pgsql: Improve the error message given for modifying a window with fram
Previous Message Tom Lane 2013-11-05 22:52:21 pgsql: Revert commit 0725065b37b8b0e9074a624a8d3e3ac1844fc820.