Customize psql prompt to show current_role

From: Dominique Devienne <ddevienne(at)gmail(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Customize psql prompt to show current_role
Date: 2024-09-23 09:30:46
Message-ID: CAFCRh-_VwScttZi4R8grSd-b=7qguAnSzXp_+jbdpUkp=TfxPQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi. I've successfully customized my psql PROMPT1,
using %n for session_user, but I'd like to see
current_role as well. And I can't seem to find a way.

I didn't find a direct \x for it.
I didn't find a %'X' variable for it.
I didn't find a command to %`X` either.
(and X = `select current_role` does not work).

Surely there's a way, no? Thanks, --DD

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Asad Ali 2024-09-23 12:22:29 Re: Customize psql prompt to show current_role
Previous Message rob stone 2024-09-23 04:43:46 Re: IO related waits