Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has) - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Date
Msg-id e0320ffa-97ac-5976-ea76-2b9e87dd054c@iki.fi
Whole thread Raw
In response to Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Responses Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
List pgsql-hackers
On 23/02/2023 13:20, Peter Eisentraut wrote:
> On 22.02.23 19:14, Heikki Linnakangas wrote:
>> How about a new backslash command or psql variable to show how long the
>> previous statement took? Something like:
> 
> If you don't have \timing turned on before the query starts, psql won't
> record what the time was before the query, so you can't compute the run
> time afterwards.  This kind of feature would only work if you always
> take the start time, even if \timing is turned off.

Correct. That seems acceptable though? gettimeofday() can be slow on 
some platforms, but I doubt it's *that* slow, that we couldn't call it 
two times per query.

- Heikki




pgsql-hackers by date:

Previous
From: Melih Mutlu
Date:
Subject: Re: Allow logical replication to copy tables in binary format
Next
From: "Hayato Kuroda (Fujitsu)"
Date:
Subject: RE: Time delayed LR (WAS Re: logical replication restrictions)