Better error message for window-function spec bizarreness
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