Re: Customize psql prompt to show current_role - Mailing list pgsql-general

From Greg Sabino Mullane
Subject Re: Customize psql prompt to show current_role
Date
Msg-id CAKAnmmLPBSErcRJmMOOdOOHUHrjopDC7Th1Un3rJtHDqH3y2nQ@mail.gmail.com
Whole thread Raw
In response to Re: Customize psql prompt to show current_role  (Asad Ali <asadalinagri@gmail.com>)
List pgsql-general
On Mon, Sep 23, 2024 at 8:22 AM Asad Ali <asadalinagri@gmail.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

pgsql-general by date:

Previous
From: Dominique Devienne
Date:
Subject: Re: Customize psql prompt to show current_role
Next
From: Laurenz Albe
Date:
Subject: Re: Customize psql prompt to show current_role