Thread: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Attachment
On 01.03.23 01:59, Kirk Wolak wrote: > I cannot get the last email to show up for the commitfest. > This is version 2 of the original patch. [1] > Thanks Jim! > > [1]https://postgr.es/m/CACLU5mSRwHr_8z%3DenMj-nXF1tmC7%2BJn5heZQNiKuLyxYUtL2fg%40mail.gmail.com > > Regards Kirk. The patch didn't pass the SanityCheck: https://cirrus-ci.com/task/5445242183221248?logs=build#L1337 missing a header perhaps? #include "time.h" Best, Jim
On 01.03.23 01:59, Kirk Wolak wrote:
> I cannot get the last email to show up for the commitfest.
> This is version 2 of the original patch. [1]
> Thanks Jim!
>
> [1]https://postgr.es/m/CACLU5mSRwHr_8z%3DenMj-nXF1tmC7%2BJn5heZQNiKuLyxYUtL2fg%40mail.gmail.com
>
> Regards Kirk.
The patch didn't pass the SanityCheck:
https://cirrus-ci.com/task/5445242183221248?logs=build#L1337
missing a header perhaps?
#include "time.h"
Best, Jim
Attachment
Thanks, corrected, and confirmed Unix line endings.FWIW, the simplest way to test it is with this command (I usually get it wrong on the first guess)\set PROMPT1 %T ' ' :PROMPT1Kirk
Nice. The patch applies clean and the cfbots seem much happier now - all passed.
17:23:19 postgres=# SELECT now();
now
-------------------------------
2023-03-01 17:23:19.807339+01
(1 row)
The docs render also just fine. I'm now wondering if HH24:MI:SS should be formatted with, e.g. using <literal>
"The current time on the client in <literal>HH24:MI:SS</literal> format."
But that I'll leave to the docs experts to judge :)
Best, Jim
On 01.03.23 17:13, Kirk Wolak wrote:Thanks, corrected, and confirmed Unix line endings.FWIW, the simplest way to test it is with this command (I usually get it wrong on the first guess)\set PROMPT1 %T ' ' :PROMPT1KirkNice. The patch applies clean and the cfbots seem much happier now - all passed.
17:23:19 postgres=# SELECT now();
now
-------------------------------
2023-03-01 17:23:19.807339+01
(1 row)The docs render also just fine. I'm now wondering if HH24:MI:SS should be formatted with, e.g. using <literal>
"The current time on the client in <literal>HH24:MI:SS</literal> format."
But that I'll leave to the docs experts to judge :)
Best, Jim
Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)
On Wed, 2023-03-01 at 11:13 -0500, Kirk Wolak wrote: > Thanks, corrected, and confirmed Unix line endings. The patch builds fine and works as intended. I leave it to the committers to decide whether the patch is worth the effort or not, given that you can get a similar effect with %`date`. It adds some value by being simpler and uniform across all platforms. I'll mark the patch as "ready for committer". Yours, Laurenz Albe
On Wed, 2023-03-01 at 11:13 -0500, Kirk Wolak wrote:
> Thanks, corrected, and confirmed Unix line endings.
The patch builds fine and works as intended.
I leave it to the committers to decide whether the patch is worth the
effort or not, given that you can get a similar effect with %`date`.
It adds some value by being simpler and uniform across all platforms.
I'll mark the patch as "ready for committer".
Yours,
Laurenz Albe
in windows: `ECHO %time%`
so, I wrote a ts.cmd and ts.sh so I could share one prompt: `ts`
but now every time I connect a new account to this file, I have to go find/copy my ts file.
This was the pain that started the quest.
Thanks to everyone for their support!