psql: backslash fix

Поиск
Список
Период
Сортировка
От nconway@klamath.dyndns.org (Neil Conway)
Тема psql: backslash fix
Дата
Msg-id 20020311212949.GA6215@klamath.dyndns.org
обсуждение исходный текст
Ответы Re: psql: backslash fix  (Peter Eisentraut <peter_e@gmx.net>)
Re: psql: backslash fix  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-patches
Hi all,

Recently, I reported on -hackers a strange case where psql wouldn't
reset it's query buffer properly on a malformed backslash command, which
would mean that the next query wouldn't be parsed properly. For
instance:

nconway=> select foo\\bar;
Invalid command \. Try \? for help.
nconway-> select 1;
ERROR:  parser: parse error at or near "select"

I've attached a patch which fixes this. I'm not sure if it is the
"right" way to fix it, but it resolves the situation discribed above, at
least. The new behavior is:

nconway=> select foo\\bar;
Invalid command \. Try \? for help.
ERROR:  Attribute 'foo' not found
nconway=> select 1;
 ?column?
 ----------
         1
(1 row)

Unless anyone sees any problems, please apply.

Cheers,

Neil

--
Neil Conway <neilconway@rogers.com>
PGP Key ID: DB3C29FC

Вложения

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Domain Support -- another round
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: psql: backslash fix