Re: BUG #15555: Syntax errors when using the COMMENT command in plpgsql and a "comment" variable

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: feikesteenbergen(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15555: Syntax errors when using the COMMENT command in plpgsql and a "comment" variable
Date: 2018-12-17 22:05:58
Message-ID: 23647.1545084358@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Attachment Content-Type Size
plpgsql-still-less-reserved-1.patch text/x-diff 8.0 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2018-12-18 00:31:27 Re: ALTER INDEX ... ALTER COLUMN not present in dump
Previous Message Tom Lane 2018-12-17 20:47:06 Re: BUG #15555: Syntax errors when using the COMMENT command in plpgsql and a "comment" variable