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

From Nathan Bossart
Subject Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Date
Msg-id 20230222194215.GA144567@nathanxps13
Whole thread Raw
In response to Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)  (Daniel Gustafsson <daniel@yesql.se>)
List pgsql-hackers
On Wed, Feb 22, 2023 at 07:17:37PM +0100, Daniel Gustafsson wrote:
>> On 22 Feb 2023, at 19:14, Heikki Linnakangas <hlinnaka@iki.fi> wrote:
> 
>> How about a new backslash command or psql variable to show how long the previous statement took? Something like:
>> 
>> postgres=# select <unexpectedly slow query>
>> ?column?
>> ----------
>>      123
>> (1 row)
>> 
>> postgres=# \time
>> 
>> Time: 14011.975 ms (00:14.012)
>> 
>> This would solve the "I forgot to time something" problem.
> 
> I don't have an opinion on adding a prompt option, but I've wanted this
> (without realizing this was the format of it) many times.

+1

-- 
Nathan Bossart
Amazon Web Services: https://aws.amazon.com



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: meson and sslfiles.mk in src/test/ssl/
Next
From: Heikki Linnakangas
Date:
Subject: Re: [PATCH] Fix unbounded authentication exchanges during PQconnectPoll()