Re: psql now shows zero elapsed time after an error

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: psql now shows zero elapsed time after an error
Дата
Msg-id alpine.DEB.2.22.394.2205101526240.1550767@pseudo
обсуждение исходный текст
Ответ на Re: psql now shows zero elapsed time after an error  (Richard Guo <guofenglinux@gmail.com>)
Ответы Re: psql now shows zero elapsed time after an error  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
Hello,

Thanks for the catch and the proposed fix! Indeed, on errors the timing is 
not updated appropriately.

ISTM that the best course is to update the elapsed time whenever a result 
is obtained, so that a sensible value is always available.

See attached patch which is a variant of Richard's version.

  fabien=# SELECT 1 as one \; SELECT 1/0 \; SELECT 2 as two;
  ┌─────┐
  │ one │
  ├─────┤
  │   1 │
  └─────┘
  (1 row)

  ERROR:  division by zero
  Time: 0,352 ms

Probably it would be appropriate to add a test case. I'll propose 
something later.

-- 
Fabien.
Вложения

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

Предыдущее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Proposal: add a debug message about using geqo
Следующее
От: Ashutosh Bapat
Дата:
Сообщение: Re: Allowing REINDEX to have an optional name