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