| От | Ryoga Yoshida |
|---|---|
| Тема | Bug fix for psql's meta-command \ev |
| Дата | |
| Msg-id | 01419622d84ef093fd4fe585520bf03c@oss.nttdata.com обсуждение исходный текст |
| Ответы |
Re: Bug fix for psql's meta-command \ev
Re: Bug fix for psql's meta-command \ev |
| Список | pgsql-hackers |
Hi,
When a table name is specified as the first argument of \ev
meta-command, it reports the error message, the prompt string becomes
"-#" and then the following valid query fails because the psql's query
buffer contains the garbage string generated by failure of \ev. Please
see the following example.
=# \ev t
"public.t" is not a view
-# SELECT * FROM t;
ERROR: syntax error at or near "public" at character 1
STATEMENT: public.t AS
SELECT * FROM t;
I think this is a bug in psql's \ev meta-command. Even when \ev fails,
it should not leave the garbage string in psql's query buffer and the
following query should be completed successfully.
This problem can be resolved by resetting the query buffer on error. You
can see the attached source code. After that, it will result in output
like the following:
=# \ev t
"public.t" is not a view
=# SELECT * FROM t;
i
---
1
2
(2 rows)
Ryoga Yoshida
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера