Re: Customize psql prompt to show current_role

From: Greg Sabino Mullane <htamfids(at)gmail(dot)com>
To: Asad Ali <asadalinagri(at)gmail(dot)com>
Cc: Dominique Devienne <ddevienne(at)gmail(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Customize psql prompt to show current_role
Date: 2024-09-23 13:02:57
Message-ID: CAKAnmmLPBSErcRJmMOOdOOHUHrjopDC7Th1Un3rJtHDqH3y2nQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Sep 23, 2024 at 8:22 AM Asad Ali <asadalinagri(at)gmail(dot)com> wrote:

> There is no direct prompt escape sequence like %n for displaying the
> current_role in the psql prompt. However, you can work around this by using
> a \set command to define a custom prompt that includes the result of
> current_role.
>

Please do not use chatgpt or other LLMs to answer questions on this mailing
list! If you had even done the bare minimum of trying your own
lazily-generated answer, you would have found it did not work.

Greg

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Laurenz Albe 2024-09-23 13:05:10 Re: Customize psql prompt to show current_role
Previous Message Dominique Devienne 2024-09-23 12:59:43 Re: Customize psql prompt to show current_role