Better error message for window-function spec bizarreness

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-hackers(at)postgreSQL(dot)org
Subject: Better error message for window-function spec bizarreness
Date: 2013-11-05 18:13:10
Message-ID: 22948.1383675190@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

We've had a couple of complaints about the error message that's thrown
for the case where you try to copy-and-modify a window definition that
includes a frame clause:
http://www.postgresql.org/message-id/200911191711.nAJHBped009004@wwwmaster.postgresql.org
http://www.postgresql.org/message-id/CADyrUxP-5pNAqxjuFx9ToeTEhsxwo942PS3Bk_=JEKdMVg0W7A@mail.gmail.com

I propose the attached patch, which changes the text of the message to
"cannot copy window \"%s\" because it has a frame clause", and then adds
a HINT "Omit the parentheses in this OVER clause." if the clause is just
OVER (windowname) and doesn't include any attempt to modify the window's
properties.

I think we should back-patch this into all versions that have window
functions (ie, all supported branches).

Any objections or better ideas?

regards, tom lane

Attachment Content-Type Size
better-window-error-message.patch text/x-diff 3.3 KB

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2013-11-05 18:25:58 Re: Handle LIMIT/OFFSET before select clause (was: Feature request: optimizer improvement)
Previous Message Noah Misch 2013-11-05 18:08:28 Re: List of "binary-compatible" data types