Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)

From: Nikolay Samokhvalov <samokhvalov(at)gmail(dot)com>
To: Kirk Wolak <wolakk(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, amborodin86(at)gmail(dot)com, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
Subject: Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Date: 2023-02-22 17:52:28
Message-ID: CANNMO++9ZauZ7tZFO6vcc_Kah7UysLpYP94XQtGVA12hwnoiAQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 22, 2023 at 9:18 AM Kirk Wolak <wolakk(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2023-02-22 17:55:25 Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Previous Message Jacob Champion 2023-02-22 17:42:54 Re: meson and sslfiles.mk in src/test/ssl/