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

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Stark <stark(at)mit(dot)edu>, Kirk Wolak <wolakk(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, amborodin86(at)gmail(dot)com, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, samokhvalov(at)gmail(dot)com
Subject: Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Date: 2023-04-09 04:16:58
Message-ID: CAFj8pRDycv1c2nVw2yus+Oow1sD3s_SbS6mp8CeBTBQwoU=-pg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

ne 9. 4. 2023 v 3:54 odesílatel Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> napsal:

> Greg Stark <stark(at)mit(dot)edu> writes:
> > I'm not sure if the *prompt* is a sensible place for it though. The
> > place it seems like it would be most useful is reading the output of
> > script executions where there would be no prompts. Perhaps it's the
> > command tags and \echo statements that should be timestamped.
>
> Hmm, that is an interesting idea. I kind of like it, not least because
> it eliminates most of the tension between wanting a complete timestamp
> and wanting a short prompt. Command tags are short enough that there's
> plenty of room.
>

I don't agree so there is a common request for a short prompt. Usually I
use four terminals on screen, and still my terminal has a width of 124
characters (and I use relatively small display of my Lenovo T520). Last
years I use prompt like:

(2023-04-09 06:08:30) postgres=# select 1;
┌──────────┐
│ ?column? │
╞══════════╡
│ 1 │
└──────────┘
(1 row)

and it is working. Nice thing when I paste the timestamp in examples. I
have not any problems with prompt width

Regards

Pavel

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Noah Misch 2023-04-09 04:29:54 Re: Direct I/O
Previous Message Gregory Stark (as CFM) 2023-04-09 03:01:24 Re: Use fadvise in wal replay