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

From Pavel Stehule
Subject Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Date
Msg-id CAFj8pRDycv1c2nVw2yus+Oow1sD3s_SbS6mp8CeBTBQwoU=-pg@mail.gmail.com
Whole thread Raw
In response to Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers


ne 9. 4. 2023 v 3:54 odesílatel Tom Lane <tgl@sss.pgh.pa.us> napsal:
Greg Stark <stark@mit.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




pgsql-hackers by date:

Previous
From: "Gregory Stark (as CFM)"
Date:
Subject: Re: Use fadvise in wal replay
Next
From: Noah Misch
Date:
Subject: Re: Direct I/O