Re: session username in default psql prompt?

2024-04-11 Thread jian he
On Tue, Mar 26, 2024 at 7:14 AM Andrew Dunstan wrote: > > > > On Mon, Mar 25, 2024 at 9:14 AM Jelte Fennema-Nio wrote: >> >> On Mon, 25 Mar 2024 at 14:06, Robert Haas wrote: >> > On Mon, Mar 25, 2024 at 4:30 AM Jelte Fennema-Nio >> > wrote: >> > > That problem seems easy to address by adding

Re: session username in default psql prompt?

2024-03-25 Thread Andrew Dunstan
On Mon, Mar 25, 2024 at 9:14 AM Jelte Fennema-Nio wrote: > On Mon, 25 Mar 2024 at 14:06, Robert Haas wrote: > > On Mon, Mar 25, 2024 at 4:30 AM Jelte Fennema-Nio > wrote: > > > That problem seems easy to address by adding a newline into the > > > default prompt. > > > > Ugh. Please, no! > > I

Re: session username in default psql prompt?

2024-03-25 Thread Jelte Fennema-Nio
On Mon, 25 Mar 2024 at 14:06, Robert Haas wrote: > On Mon, Mar 25, 2024 at 4:30 AM Jelte Fennema-Nio wrote: > > That problem seems easy to address by adding a newline into the > > default prompt. > > Ugh. Please, no! I guess it's partially a matter of taste, but personally I'm never going back

Re: session username in default psql prompt?

2024-03-25 Thread Robert Haas
On Mon, Mar 25, 2024 at 4:30 AM Jelte Fennema-Nio wrote: > That problem seems easy to address by adding a newline into the > default prompt. Ugh. Please, no! -- Robert Haas EDB: http://www.enterprisedb.com

Re: session username in default psql prompt?

2024-03-25 Thread Jelte Fennema-Nio
On Mon, 25 Mar 2024 at 11:40, jian he wrote: > transaction related information lost. Ah yeah, it seems I somehow lost the %x How about: \set PROMPT1 '%n@%~\n%R%x%# ' Or maybe even this more verbose one, which closely matches the postgresql:// connection string format: \set PROMPT1

Re: session username in default psql prompt?

2024-03-25 Thread jian he
On Mon, Mar 25, 2024 at 6:32 PM Jelte Fennema-Nio wrote: > > Obviously I meant to put the \n before the %: > \set PROMPT1 '%n@%~%R\n%# ' > transaction related information lost. for example: jian@src6= # begin; BEGIN jian@src6= # select 1/0; 2024-03-25 18:37:59.313 CST [15252] ERROR: division

Re: session username in default psql prompt?

2024-03-25 Thread Jelte Fennema-Nio
On Mon, 25 Mar 2024 at 09:30, Jelte Fennema-Nio wrote: > \set PROMPT1 '%n@%~%R%\n# ' Obviously I meant to put the \n before the %: \set PROMPT1 '%n@%~%R\n%# '

Re: session username in default psql prompt?

2024-03-25 Thread Jelte Fennema-Nio
On Sat, 23 Mar 2024 at 00:34, Tom Lane wrote: > Prompt space is > expensive and precious, at least for people who aren't in the > habit of working in very wide windows. That problem seems easy to address by adding a newline into the default prompt. Something like this: \set PROMPT1 '%n@%~%R%\n#

Re: session username in default psql prompt?

2024-03-22 Thread Andrew Dunstan
On Fri, Mar 22, 2024 at 7:34 PM Tom Lane wrote: > > On the whole, I think we'd get more complaints about the default > prompt having more-or-less doubled in length than we'd get kudos > about this being a great usability improvement. Prompt space is > expensive and precious, at least for people

Re: session username in default psql prompt?

2024-03-22 Thread Tom Lane
Andrew Dunstan writes: > On Fri, Mar 22, 2024 at 4:04 PM Robert Haas wrote: >> I'm not really a fan of this. Right now my prompt looks like this: >> robert.haas=# >> If we did this, it would say: >> robert.h...@robert.haas=# There would be similar duplication for, eg, the postgres user

Re: session username in default psql prompt?

2024-03-22 Thread Andrew Dunstan
On Fri, Mar 22, 2024 at 4:04 PM Robert Haas wrote: > On Wed, Mar 13, 2024 at 4:56 AM Andrew Dunstan > wrote: > > Reposting as the archive mail processor doesn't seem to like the Apple > > mail attachment. > > I'm not really a fan of this. Right now my prompt looks like this: > > robert.haas=# >

Re: session username in default psql prompt?

2024-03-22 Thread Robert Haas
On Wed, Mar 13, 2024 at 4:56 AM Andrew Dunstan wrote: > Reposting as the archive mail processor doesn't seem to like the Apple > mail attachment. I'm not really a fan of this. Right now my prompt looks like this: robert.haas=# If we did this, it would say: robert.h...@robert.haas=# I have

Re: session username in default psql prompt?

2024-03-13 Thread Andrew Dunstan
On 2024-02-27 Tu 19:19, Kori Lane wrote: Here’s a patch for this. Reposting as the archive mail processor doesn't seem to like the Apple mail attachment. cheers andrew -- Andrew Dunstan EDB: https://www.enterprisedb.com diff --git a/doc/src/sgml/ref/psql-ref.sgml

Re: session username in default psql prompt?

2024-02-27 Thread Kori Lane
Here’s a patch for this.- Kori session-user-prompt.patch Description: Binary data On May 27, 2023, at 8:52 AM, Andrew Dunstan 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

Re: session username in default psql prompt?

2023-05-27 Thread Junwang Zhao
I'd like to take this if this is approved ;) On Sat, May 27, 2023 at 8:52 PM Andrew Dunstan 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 customer shows me a screen and