Re: Customize psql prompt to show current_role

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Customize psql prompt to show current_role
Дата
Msg-id 3085360.1727105807@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Customize psql prompt to show current_role  (Adrian Klaver <adrian.klaver@aklaver.com>)
Список pgsql-general
Adrian Klaver <adrian.klaver@aklaver.com> writes:
> On 9/23/24 08:07, Dominique Devienne wrote:
>> I often resort to \conninfo, but it's less automatic and
>> harder to visually parse (IMHO) compared to a custom ad-hoc prompt.

> For me that shows the user that connected(session_user) not the 
> current_user.

Worse than that: what it reports is libpq's PQuser(), that is the
name that was used to log in with.  But if what you want is the
session_user, psql prompts already have %n for that.

            regards, tom lane



В списке pgsql-general по дате отправления: