session username in default psql prompt?

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема session username in default psql prompt?
Дата
Msg-id e2617e17-5f84-b43e-c58e-738bdca75b07@dunslane.net
обсуждение исходный текст
Ответы Re: session username in default psql prompt?  (Junwang Zhao <zhjwpku@gmail.com>)
Re: session username in default psql prompt?  (Kori Lane <kori.lane@enterprisedb.com>)
Список pgsql-hackers

I don't recall if this has come up before.

I'm sometimes mildly annoyed when I get on a new system and find the username missing in my psql prompt. Or if a customer shows me a screen and I have to ask "which user is this". If we're dealing with several roles it can get confusing. My usual .psqlrc has

   \set PROMPT1 '%n@%~%R%x%# '

So my suggestion is that we prepend '%n@' to the default psql PROMPT1 (and maybe PROMPT2).

I realize it's not exactly earth-shattering, but I think it's a bit more user-friendly.

(Would be a good beginner project, the code change would be tiny but there are lots of docs / examples that we might want to change if we did it.)


cheers


andrew

--
Andrew Dunstan
EDB: https://www.enterprisedb.com

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

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Implement generalized sub routine find_in_log for tap test
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Why does pg_bsd_indent need to be installed?