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

Поиск
Список
Период
Сортировка
От Kirk Wolak
Тема Proposal: %T Prompt parameter for psql for current time (like Oracle has)
Дата
Msg-id CACLU5mSRwHr_8z=enMj-nXF1tmC7+Jn5heZQNiKuLyxYUtL2fg@mail.gmail.com
обсуждение исходный текст
Ответы Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)  (Nikolay Samokhvalov <samokhvalov@gmail.com>)
Re: Proposal: %T Prompt parameter for psql for current time (like Oracle has)  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
Proposal:  Simply add the %T (PROMPT variable) to output the current time (HH24:MI:SS) into the prompt.  This has been in sqlplus since I can remember, and I find it really useful when I forgot to time something, or to review for Time spent on a problem, or for how old my session is...

I am recommending no formatting options, just keep it simple.  No, I don't care about adding the date.  If I don't know the date of some line in my history, it's already a problem!  (And date would logically be some other variable)

Yes, I've found ways around it using the shell backquote.  This is hacky, and it's also really ugly in windows. I also found it impossible to share my plpgsqlrc file because between linux and windows.

This would be current time on the local machine.  Keeping it simple.

It feels like a small change.  The simplest test would be to capture the prompt, select sleep(1.1); and make sure the prompt change.  This code should be trivially stable.

If it seems useful, I believe I can work with others to get it implemented, and the documentation changed, and a patch generated.  (I need to develop these skills)

What does the community say?  Is there support for this?

Regards, Kirk


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Nathan Bossart
Дата:
Сообщение: Re: DDL result is lost by CREATE DATABASE with WAL_LOG strategy
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Non-superuser subscription owners