Re: improve pgbench syntax error messages

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: improve pgbench syntax error messages
Дата
Msg-id alpine.DEB.2.10.1503041720550.15572@sto
обсуждение исходный текст
Ответ на Re: improve pgbench syntax error messages  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: improve pgbench syntax error messages  (Fabien COELHO <coelho@cri.ensmp.fr>)
Список pgsql-hackers
> As I mentioned on the other thread, I'd really like to get this into a
> better format, where each error message is on one line.  Looking at
> that, you can't tell whether you've got one mistake, two mistakes, or
> three mistakes.

Indeed. Here is a v2.
  sh> ./pgbench -f bad.sql  bad.sql:3: syntax error at column 23 in command "set"  \set aid (1021 * :id) %
         ^ error found here
 
  sh> ./pgbench -f bad2.sql  bad2.sql:1: unexpected argument (x) at column 25 in command "setrandom"     \setrandom id
11000 x                          ^ error found here
 
  sh> ./pgbench -f bad3.sql  bad3.sql:1: too many arguments (gaussian) at column 35 in command "setrandom"  \setrandom
foo1 10 gaussian 10.3 1                                    ^ error found here
 
 sh> ./pgbench -f bad4.sql  bad4.sql:1: missing threshold argument (exponential) in command "setrandom"  \setrandom foo
110 exponential
 


I think that transforming unexpected garbage in errors would be a good 
move, even if this breaks backwards compatibility (currently a warning is 
printed about ignored extra stuff).

-- 
Fabien.

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: xpath changes in the recent back branches
Следующее
От: Robert Haas
Дата:
Сообщение: Re: failures with tuplesort and ordered set aggregates (due to 5cefbf5a6c44)