public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Customize psql prompt to show current_role
3+ messages / 2 participants
[nested] [flat]

* Re: Customize psql prompt to show current_role
@ 2024-09-23 15:37  Dominique Devienne <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Dominique Devienne @ 2024-09-23 15:37 UTC (permalink / raw)
  To: Adrian Klaver <[email protected]>; +Cc: Tom Lane <[email protected]>; Laurenz Albe <[email protected]>; Erik Wienhold <[email protected]>; Asad Ali <[email protected]>; pgsql-general

On Mon, Sep 23, 2024 at 5:16 PM Adrian Klaver <[email protected]> wrote:
> 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.

yeah, sure, I realized that just after sending my last post...
I resort to using both \conninfo *and* `select current_role`.
I used \conninfo to tell me which server I'm on (since not
on the default prompt, before I played with it today), which
session_user I'm connected with (ddevienne or dd_login
in my recent example), and finally `select current_role`
which matters in my use-cases (session_user or dd_admin or dd_user).

I'd like not to have to type those commands/queries all the time,
and have them in the prompt at all time. I get that it's not for everyone,
nor even necessary all the time, but I sincerely think it is definitely useful.

I'd be glad to use Pavel's proposed %N. --DD






^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Customize psql prompt to show current_role
@ 2024-11-27 14:14  Raphael Salguero Aragón <[email protected]>
  parent: Dominique Devienne <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: Raphael Salguero Aragón @ 2024-11-27 14:14 UTC (permalink / raw)
  To: Dominique Devienne <[email protected]>; Tom Lane <[email protected]>; +Cc: Adrian Klaver <[email protected]>; Laurenz Albe <[email protected]>; Erik Wienhold <[email protected]>; Asad Ali <[email protected]>; pgsql-general

Am 23.09.2024 um 17:37 schrieb Dominique Devienne <[email protected]>:
> 
> On Mon, Sep 23, 2024 at 5:16 PM Adrian Klaver <[email protected]> wrote:
>> 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.
> 
> yeah, sure, I realized that just after sending my last post...
> I resort to using both \conninfo *and* `select current_role`.
> I used \conninfo to tell me which server I'm on (since not
> on the default prompt, before I played with it today), which
> session_user I'm connected with (ddevienne or dd_login
> in my recent example), and finally `select current_role`
> which matters in my use-cases (session_user or dd_admin or dd_user).
> 
> I'd like not to have to type those commands/queries all the time,
> and have them in the prompt at all time. I get that it's not for everyone,
> nor even necessary all the time, but I sincerely think it is definitely useful.
> 
> I'd be glad to use Pavel's proposed %N. —DD
> 


Hi all,

I just wanted to add that we are also supporting a larger customer with exactly the same request.
Perhaps this increases the value of the adjustment a little more :)

Best regards!
 Raphael Salguero





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Customize psql prompt to show current_role
@ 2024-11-27 14:45  Dominique Devienne <[email protected]>
  parent: Raphael Salguero Aragón <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Dominique Devienne @ 2024-11-27 14:45 UTC (permalink / raw)
  To: Raphael Salguero Aragón <[email protected]>; +Cc: Tom Lane <[email protected]>; Adrian Klaver <[email protected]>; Laurenz Albe <[email protected]>; Erik Wienhold <[email protected]>; Asad Ali <[email protected]>; pgsql-general

On Wed, Nov 27, 2024 at 3:14 PM Raphael Salguero Aragón
<[email protected]> wrote:
> Am 23.09.2024 um 17:37 schrieb Dominique Devienne <[email protected]>:
> > I'd be glad to use Pavel's proposed %N. —DD
> I just wanted to add that we are also supporting a larger customer with exactly the same request.
> Perhaps this increases the value of the adjustment a little more :)

Hi. Thanks for sharing Raphael. That's a 3rd notch Tom! :)
So is it the proverbial "third time's a charm" and the community would
revise its initial rejection?
I keep making that point, but the fact this is entirely opt-in,
mitigates the "expensive" argument IMHO.
FWIW. Thank you for considering this RFC again, especially since
there's a patch for it. Respectfully, --DD






^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2024-11-27 14:45 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-23 15:37 Re: Customize psql prompt to show current_role Dominique Devienne <[email protected]>
2024-11-27 14:14 ` Raphael Salguero Aragón <[email protected]>
2024-11-27 14:45   ` Dominique Devienne <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox