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

From: Greg Stark <stark(at)mit(dot)edu>
To: Kirk Wolak <wolakk(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, 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>, samokhvalov(at)gmail(dot)com
Subject: Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Date: 2023-04-09 01:24:46
Message-ID: CAM-w4HP3PKwCg2QfV4iN9w9xTvborFAhz3MQ-CVJy_iZPZkatw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 22 Feb 2023 at 13:38, Kirk Wolak <wolakk(at)gmail(dot)com> wrote:
>
> I already requested ONLY the HH24 format. 8 characters of output. no options. It's a waste of time.
> After all these years, sqlplus still has only one setting (show it, or not). I am asking the same here.
> And I will gladly defend not changing it! Ever!

Yeah, well, it's kind of beside the point that you're satisfied with
this one format. We tend to think about what all users would expect
and what a complete feature would look like.

I actually tend to think this would be a nice feature. It's telling
that log files and other tracing tools tend to produce exactly this
type of output with every line prefixed with either a relative or
absolute timestamp.

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.

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.

--
greg

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Gregory Stark (as CFM) 2023-04-09 01:45:04 Re: Commitfest 2023-03 starting tomorrow!
Previous Message Tom Lane 2023-04-08 23:05:22 Re: Direct I/O