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

From Nikolay Samokhvalov
Subject Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Date
Msg-id CANNMO++9ZauZ7tZFO6vcc_Kah7UysLpYP94XQtGVA12hwnoiAQ@mail.gmail.com
Whole thread Raw
In response to Proposal: %T Prompt parameter for psql for current time (like Oracle has)  (Kirk Wolak <wolakk@gmail.com>)
List pgsql-hackers
On Wed, Feb 22, 2023 at 9:18 AM Kirk Wolak <wolakk@gmail.com> wrote:
Proposal:  Simply add the %T (PROMPT variable) to output the current time (HH24:MI:SS) into the prompt.  This has been in sqlplus since I can remember, and I find it really useful when I forgot to time something, or to review for Time spent on a problem, or for how old my session is...

This is a great idea, in my opinion. I usually do something involving ts to track timestamps when executing something non-trivial via psql in interactive (see below) or non-interactive mode. 

But this is a not well-known thing to use (and ts is not installed by default on Ubuntu, etc.) – having timestamps in prompt would be convenient.

test=> \o | ts
test=> select 1;
test=> Feb 22 09:49:49  ?column?
Feb 22 09:49:49 ----------
Feb 22 09:49:49         1
Feb 22 09:49:49 (1 row)
Feb 22 09:49:49

pgsql-hackers by date:

Previous
From: Jacob Champion
Date:
Subject: Re: meson and sslfiles.mk in src/test/ssl/
Next
From: Tom Lane
Date:
Subject: Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)