Database bar - Mailing list pgadmin-hackers

From Erwin Brandstetter
Subject Database bar
Date
Msg-id 4DC2C14F.7010106@falter.at
Whole thread Raw
Responses Re: Database bar
List pgadmin-hackers
Aloha!

I have had a closer look at the status of the "database bar" or "database selector" in the sql editor in v1.12.3 and
v1.14beta1.
Testing on Win XP Pro with pg 8.4 on Debian Lenny.
Sorry for nagging, but that is my role here ...

In 1.12.3:
The bug I reported previously is still there. The username is not picked as it should. (Guillaume could not reproduce
theissue, maybe someone else  
can contribute a test?)
     http://archives.postgresql.org/pgadmin-support/2011-01/msg00042.php


In 1.14:
- Same bug as above.

- 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@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
sometime to figure it out.  
Nothing in the help yet.
- 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.
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 ...

If we keep this functionality the database bar would have to show the currently active role IMHO.
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.
Seeattached screenshot. 


Regards
Erwin



Attachment

pgadmin-hackers by date:

Previous
From: Dave Page
Date:
Subject: Re: Warning about PNGs
Next
From: Guillaume Lelarge
Date:
Subject: Re: Database bar