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

From Tom Lane
Subject Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Date
Msg-id 3673996.1681005278@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)  (Greg Stark <stark@mit.edu>)
Responses Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
List pgsql-hackers
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.

> And I think experience shows that there are three reasonable formats
> for dates, the default LC_TIME format, ISO8601, and a relative
> "seconds (with milliseconds) since starting". I think having a feature
> that doesn't support those three would feel incomplete and eventually
> need to be finished.

Yeah, I don't believe that one timestamp format is going to satisfy
everyone.  But that was especially true when trying to wedge it
into the prompt, where the need for brevity adds more constraints.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Commitfest 2023-03 starting tomorrow!
Next
From: Thomas Munro
Date:
Subject: Re: Direct I/O