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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #15555: Syntax errors when using the COMMENT command in plpgsql and a "comment" variable
Дата
Msg-id 32114.1545079626@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #15555: Syntax errors when using the COMMENT command in plpgsql and a "comment" variable  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #15555: Syntax errors when using the COMMENT command in plpgsql and a "comment" variable  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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.

Digging in the commit history, that code all dates to commit bb1b8f69,
which arose from a discussion about making plpgsql keywords unreserved:

https://www.postgresql.org/message-id/5030.1416778830%40sss.pgh.pa.us

AFAICS, the question of conflicts against core-parser keywords didn't
come up at all in that thread, so it's not surprising we didn't consider
that case.  I don't see any indication that we explicitly rejected
doing something for that case.

There's still the question of whether there are any cases where we
*need* to recognize a variable name that's at statement start and
isn't followed by assignment or '['.

            regards, tom lane


В списке pgsql-bugs по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15548: Unaccent does not remove combining diacritical characters
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #15555: Syntax errors when using the COMMENT command in plpgsql and a "comment" variable