Re: session username in default psql prompt? - Mailing list pgsql-hackers

From Junwang Zhao
Subject Re: session username in default psql prompt?
Date
Msg-id CAEG8a3JcmFoXTwDgNR+PP8U7Y74dZTCmj+a1fq3hh5B+ysfCNA@mail.gmail.com
Whole thread Raw
In response to session username in default psql prompt?  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-hackers
I'd like to take this if this is approved ;)

On Sat, May 27, 2023 at 8:52 PM Andrew Dunstan <andrew@dunslane.net> wrote:
>
> 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
customershows 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
wantto change if we did it.) 
>
>
> cheers
>
>
> andrew
>
> --
> Andrew Dunstan
> EDB: https://www.enterprisedb.com



--
Regards
Junwang Zhao



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PG 16 draft release notes ready
Next
From: Thomas Munro
Date:
Subject: Re: Large files for relations