Re: session username in default psql prompt?

From: Jelte Fennema-Nio <postgres(at)jeltef(dot)nl>
To: jian he <jian(dot)universality(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Robert Haas <robertmhaas(at)gmail(dot)com>, Kori Lane <kori(dot)lane(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: session username in default psql prompt?
Date: 2024-03-25 11:03:31
Message-ID: CAGECzQSCiK-EgLNPFJ4XhkusDHKmhVh9JDKW9q2Wzw0kMjtVdQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, 25 Mar 2024 at 11:40, jian he <jian(dot)universality(at)gmail(dot)com> wrote:
> transaction related information lost.

Ah yeah, it seems I somehow lost the %x
How about:
\set PROMPT1 '%n(at)%~\n%R%x%# '

Or maybe even this more verbose one, which closely matches the
postgresql:// connection string format:

\set PROMPT1 '%n(at)%M:%>/%/\n%R%x%# '

or even add in some bold/colors like this, to make the prompt stand
out from a query:

\set PROMPT1 '%[%033[1m%]%n(at)%M:%>/%/\n%R%x%#%[%033[0m%] '

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Ashutosh Bapat 2024-03-25 11:09:27 Re: A problem about partitionwise join
Previous Message Ashutosh Bapat 2024-03-25 10:56:34 Re: Memory consumed by child SpecialJoinInfo in partitionwise join planning