Re: BUG #15555: Syntax errors when using the COMMENT command in plpgsql and a "comment" variable
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: feikesteenbergen@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Date: 2018-12-17T22:05:58Z
Lists: pgsql-bugs
Attachments
- plpgsql-still-less-reserved-1.patch (text/x-diff) patch
I wrote: >> I wonder whether we could improve matters by adjusting the heuristic for >> such things in pl_scanner.c: >> >> * If we are at start of statement, prefer unreserved keywords >> * over variable names, unless the next token is assignment or >> * '[', in which case prefer variable names. (Note we need not >> * consider '.' as the next token; that case was handled above, >> * and we always prefer variable names in that case.) If we are >> * not at start of statement, always prefer variable names over >> * unreserved keywords. [ pokes at that for a bit ] The logic here is a bit denser than one could wish, but here's a draft patch that seems to get the job done. It passes check-world, which isn't conclusive but at least suggests that this doesn't break anything. I'll add this to the next CF in hopes that somebody will try to break it. regards, tom lane
Commits
-
Support plpgsql variable names that conflict with unreserved SQL keywords.
- 4879a5172af0 12.0 landed
-
De-reserve most statement-introducing keywords in plpgsql.
- bb1b8f694ad2 9.5.0 cited