Better error message for window-function spec bizarreness

Started by Tom Laneover 12 years ago1 messageshackers
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

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:
/messages/by-id/200911191711.nAJHBped009004@wwwmaster.postgresql.org
/messages/by-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

Attachments:

better-window-error-message.patchtext/x-diff; charset=us-ascii; name=better-window-error-message.patchDownload+31-16