Skip site navigation (1) Skip section navigation (2)

Re: Database bar

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Erwin Brandstetter <brandstetter(at)falter(dot)at>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: Database bar
Date: 2011-05-05 20:50:11
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgadmin-hackers
On 05/05/2011 05:25 PM, Erwin Brandstetter wrote:
> [...]
> - There is a new feature: the rolename. This effectively issues a
> command of the form:
>     SET ROLE TO myrole;
> after connecting with the chosen username. The database bar then reads
> accordingly:
>      "mydb on myuser(at)myserver:port ~myrole"
> However!
> - Most users will not understand the dialog. Why does it ask for a
> "Username" and a "Rolename"? It certainly took me some time to figure it
> out. Nothing in the help yet.

There is so much thing not in the help that it's not surprising. I guess
nothing in 1.14 is in the docs.

> - What if someone issues one of the following commands?
>     RESET role;
>     SET ROLE TO my_other_role;
> See for yourself:
>     SELECT current_user, session_user;
> The display in the database bar remains unchanged, rendering it wrong /
> misleading.

You already have this kind of issue in 1.12 and all previous releases.
You connect with a user, you do "SET ROLE TO another_role", and the
combobox doesn't change. You could still think you're user X, but you
really are user another_role.

The combobox only tells you how you established the connection, that's all.

> Changing to another connection and changing back does not change the
> situation.


> This could get quite hazardous. Imagine a command in the mistaken belief
> it would be executed by the displayed role ...

As I said, it could already happen in 1.12.

> If we keep this functionality the database bar would have to show the
> currently active role IMHO.

No, I won't add a parser to know if the user tried to do a "SET ROLE TO".

BTW, psql does the same as us:

guillaume(at)postgres=# create user toto;
guillaume(at)postgres=# set role to toto;

See the prompt? it doesn't say toto(at)postgres(dot) Quite misleading, uh? :)

Honestly, I think you're right that it's misleading and I would agree to
add a panel to the status bar to say who's the actual role. But it means
we will fire a "select current_user;" each time the user executes a
query or a group of queries. Not sure everyone would like that.

> Otherwise I would propose to drop it altogether to keep it safe and simple.


> - Also, the "database bar" is too narrow to show the whole connection
> string, cutting off the relevant part at the end. See attached screenshot.

We could make it bigger. But it won't auto-adjust, meaning there'll
always be someone bugged by this.


In response to

  • Database bar at 2011-05-05 15:25:03 from Erwin Brandstetter


pgadmin-hackers by date

Next:From: Erwin BrandstetterDate: 2011-05-06 14:27:16
Subject: Re: Database bar
Previous:From: Erwin BrandstetterDate: 2011-05-05 15:25:03
Subject: Database bar

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group