Re: dollar quoting with flex

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: dollar quoting with flex
Дата
Msg-id 23650.1077648176@sss.pgh.pa.us
обсуждение исходный текст
Ответ на dollar quoting with flex  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-patches
Andrew Dunstan <andrew@dunslane.net> writes:
> Attached is a patch for dollar quoting in the backend and in psql (with
> the new flex scanner). I'm fairly confident about the backend (because
> this is mainly Tom's work adapted :-) ) but rather less so about psql -
> I don't entirely understand all the odd states in psql's scanner. I'm
> not sure that I have freed up memory in all the necessary cases. Nor am
> I sure what the state is or should be if we end an included file in a
> dollar-quoting state, nor how to handle such a situation. So, some extra
> eyeballs would be appreciated.

I'll take a look soon.  The psql behavior is that a new lexer is
instantiated for each include-file level, which means that quoting
states can't persist across file boundaries.  This emulates the behavior
of the old handmade lexing code, and seems fairly reasonable to me.
(By definition, you weren't in a quoting state when you recognized the
\i command, and so you shouldn't be when you come out of the include
file.)  We could argue about that if people want to reconsider it, but
it seems orthogonal to the dollar-quoting change to me.

            regards, tom lane

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: dollar quoting with flex
Следующее
От: Tom Lane
Дата:
Сообщение: Re: dollar quoting with flex