pgsql: psql: Update \timing also in case of an error

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: psql: Update \timing also in case of an error
Date: 2022-05-23 08:13:12
Message-ID: E1nt3Bf-000j6c-Op@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

psql: Update \timing also in case of an error

The changes to show all query results (7844c9918) broke \timing output
in case of an error; it didn't update the timing result and showed
0.000 ms.

Fix by updating the timing result also in the error case. Also, for
robustness, update the timing result any time a result is obtained,
not only for the last, so a sensible value is always available.

Reported-by: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Author: Richard Guo <guofenglinux(at)gmail(dot)com>
Author: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Discussion: https://www.postgresql.org/message-id/3813350.1652111765%40sss.pgh.pa.us

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9520f8d92a8681e441cc863422babd544353dd39

Modified Files
--------------
src/bin/psql/common.c | 14 ++++++++++++--
src/bin/psql/t/001_basic.pl | 12 ++++++++++--
2 files changed, 22 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Peter Eisentraut 2022-05-23 08:39:17 pgsql: doc: Add documentation for pg_database.datlocprovider column
Previous Message John Naylor 2022-05-23 06:15:41 pgsql: Remove debug messages from tuplesort_sort_memtuples()