Re: Doing psql's lexing with flex

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Doing psql's lexing with flex
Дата
Msg-id 24510.1077126148@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Doing psql's lexing with flex  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-patches
Peter Eisentraut <peter_e@gmx.net> writes:
> Feel free (or encouraged) to change the old behavior.  (Of course, the
> new behavior needs to adjustments, too.)  Generally, I think a variable
> should just stand for a data value and should not result in a slash
> command being generated.

That seems workable for :foo references in the body of a backslash
command --- you can just substitute the value but not allow it to be
split into multiple argument tokens.  However, wouldn't you still want
to rescan it for internal :bar references to other variables?  The psql
man page has some arm-waving about how you can do indirection, and seems
like that ought to work in this context too.

Also, this seems inconsistent with the non-backslash-command case.
Seems like you have to scan what goes into the query buffer to keep the
lexer state in sync, you can't just treat it as an uninterpreted token.
So not triggering on backslashes seems inconsistent.

We can certainly implement different behavior for the two cases, I'm
just unconvinced we should...

            regards, tom lane

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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: Doing psql's lexing with flex
Следующее
От: Tom Lane
Дата:
Сообщение: Re: NO WAIT ...