Re: psql now shows zero elapsed time after an error - Mailing list pgsql-hackers

From Peter Eisentraut
Subject Re: psql now shows zero elapsed time after an error
Date
Msg-id 31e904d3-59d8-1052-967e-f38f752dca12@enterprisedb.com
Whole thread Raw
In response to Re: psql now shows zero elapsed time after an error  (Fabien COELHO <coelho@cri.ensmp.fr>)
Responses Re: psql now shows zero elapsed time after an error
List pgsql-hackers
On 10.05.22 15:42, Fabien COELHO wrote:
> 
> 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.

committed with a test




pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Add --{no-,}bypassrls flags to createuser
Next
From: Chirag Karkera
Date:
Subject: Use Dblink without column defination