Thread: Database bar

Database bar

From
Erwin Brandstetter
Date:
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

Re: Database bar

From
Guillaume Lelarge
Date:
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@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.

Meaning?

> 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@postgres=# create user toto;
CREATE ROLE
guillaume@postgres=# set role to toto;
SET
guillaume@postgres=>

See the prompt? it doesn't say toto@postgres. 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.
>

-1

> - 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.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: Database bar

From
Erwin Brandstetter
Date:
Hi Guillaume!

On 05.05.2011 22:50, Guillaume Lelarge wrote:
> On 05/05/2011 05:25 PM, Erwin Brandstetter wrote:
> (...)
>> - 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.

Speaking of which: how about "Connection bar" instead of "Database bar" as title?


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

One might expect, that by chosing a connection named "mydb on myuser@myserver:port ~myrole" the role would be set as
advertised.But that's not how it  
works. (And I am not saying it should.)
I don't have a strong opinion here. My reasoning is this:
- pgAdmin is getting increasingly complex.
- Therefore, if a feature is of limited use while introducing chances for errors and misunderstandings, we should
considernot having it at all. 
If there is use cases where the feature helps a lot, my reasoning is moot.


>> 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@postgres=# create user toto;
> CREATE ROLE
> guillaume@postgres=# set role to toto;
> SET
> guillaume@postgres=>
>
> See the prompt? it doesn't say toto@postgres. 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.

To be precise: up to 1.12 the "Database bar" only displays information about the _connection_. This is always true,
evenafter SET ROLE. 
So does psql.
In 1.14 information about the _active role_ is added. But this can be false.
Firing "select current_user" each time would be an overkill for the purpose. I wouldn't like that. I would rather drop
thefeature. Typing "SET ROLE  
.." is simple enough. No need to confuse others who does not need it.

If we need to distinguish multiple connections with the same parameters, just number / name the connections. In the
caseof names, one could name it  
after the ROLE in use - or after some other equally important criteria.


>> Otherwise I would propose to drop it altogether to keep it safe and simple.
>>
> -1
>
>> - 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.

 From what I see under Windows, i would make it broader by maybe 15 %. That should cover most cases. (Not taking into
accountadditional space for the  
active role)


Regards
Erwin

Re: Database bar

From
Guillaume Lelarge
Date:
On 05/06/2011 04:27 PM, Erwin Brandstetter wrote:
> Hi Guillaume!
>
> On 05.05.2011 22:50, Guillaume Lelarge wrote:
>> On 05/05/2011 05:25 PM, Erwin Brandstetter wrote:
>> (...)
>>> - 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.
>
> Speaking of which: how about "Connection bar" instead of "Database bar"
> as title?
>

Fine to me.

>>> Changing to another connection and changing back does not change the
>>> situation.
>> Meaning?
>
> One might expect, that by chosing a connection named "mydb on
> myuser@myserver:port ~myrole" the role would be set as advertised. But
> that's not how it works. (And I am not saying it should.)
> I don't have a strong opinion here. My reasoning is this:
> - pgAdmin is getting increasingly complex.
> - Therefore, if a feature is of limited use while introducing chances
> for errors and misunderstandings, we should consider not having it at all.
> If there is use cases where the feature helps a lot, my reasoning is moot.
>
>
>>> 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@postgres=# create user toto;
>> CREATE ROLE
>> guillaume@postgres=# set role to toto;
>> SET
>> guillaume@postgres=>
>>
>> See the prompt? it doesn't say toto@postgres. 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.
>
> To be precise: up to 1.12 the "Database bar" only displays information
> about the _connection_. This is always true, even after SET ROLE.
> So does psql.
> In 1.14 information about the _active role_ is added. But this can be
> false.

So, one solution would be to get rid of the role name in the connection
combo box. Would you be happy with that solution?

> Firing "select current_user" each time would be an overkill for the
> purpose. I wouldn't like that. I would rather drop the feature. Typing
> "SET ROLE .." is simple enough. No need to confuse others who does not
> need it.
>

Seems good enough to be kept.

> If we need to distinguish multiple connections with the same parameters,
> just number / name the connections. In the case of names, one could name
> it after the ROLE in use - or after some other equally important criteria.
>
>
>>> Otherwise I would propose to drop it altogether to keep it safe and
>>> simple.
>>>
>> -1
>>
>>> - 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.
>
> From what I see under Windows, i would make it broader by maybe 15 %.
> That should cover most cases. (Not taking into account additional space
> for the active role)
>

OK.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: Database bar

From
Erwin Brandstetter
Date:
On 06.05.2011 23:40, Guillaume Lelarge wrote:
> On 05/06/2011 04:27 PM, Erwin Brandstetter wrote:
>> Hi Guillaume!
>>
>> On 05.05.2011 22:50, Guillaume Lelarge wrote:
>>> On 05/05/2011 05:25 PM, Erwin Brandstetter wrote:
>>> (...)
>>>> Changing to another connection and changing back does not change the
>>>> situation.
>>> Meaning?
>> One might expect, that by chosing a connection named "mydb on
>> myuser@myserver:port ~myrole" the role would be set as advertised. But
>> that's not how it works. (And I am not saying it should.)
>> I don't have a strong opinion here. My reasoning is this:
>> - pgAdmin is getting increasingly complex.
>> - Therefore, if a feature is of limited use while introducing chances
>> for errors and misunderstandings, we should consider not having it at all.
>> If there is use cases where the feature helps a lot, my reasoning is moot.
>>
>>
>>>> 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@postgres=# create user toto;
>>> CREATE ROLE
>>> guillaume@postgres=# set role to toto;
>>> SET
>>> guillaume@postgres=>
>>>
>>> See the prompt? it doesn't say toto@postgres. 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.
>> To be precise: up to 1.12 the "Database bar" only displays information
>> about the _connection_. This is always true, even after SET ROLE.
>> So does psql.
>> In 1.14 information about the _active role_ is added. But this can be
>> false.
> So, one solution would be to get rid of the role name in the connection
> combo box. Would you be happy with that solution?

I have given it some thought over the weekend, but there is no clean way around it. If the active role is advertised in
theconnection bar, then it  
should be the _actually_ active role. Therefore, your proposal to fire "select current_user;" after every executed
pieceof code is the proper way.  
(You would not do that for connections that have been started without SET ROLE.)
(I would still drop the feature. It adds complexity and I don't see the need.)

Not displaying the active role might be a compromise to avoid the overhead as well as false advertising.
But then: how to distinguish between several connections? You keep them in the order of their appearance, but most
peoplewill not realize that. Also  
I am not sure if that is guaranteed. How about assigning sequential numbers? Does not need much space and would help to
identify/ distinguish  
connections - epecially if the connection string gets truncated or if one opens multiple connections to the same DB.

     1: mydb on myuser@myserver:port
     2: myotherdb on myuser@myotherserver:port
     3: mydb on myuser@myserver:port


Regards
Erwin




Re: Database bar

From
Guillaume Lelarge
Date:
On 05/09/2011 07:17 PM, Erwin Brandstetter wrote:
> On 06.05.2011 23:40, Guillaume Lelarge wrote:
>> On 05/06/2011 04:27 PM, Erwin Brandstetter wrote:
>>> Hi Guillaume!
>>>
>>> On 05.05.2011 22:50, Guillaume Lelarge wrote:
>>>> On 05/05/2011 05:25 PM, Erwin Brandstetter wrote:
>>>> (...)
>>>>> Changing to another connection and changing back does not change the
>>>>> situation.
>>>> Meaning?
>>> One might expect, that by chosing a connection named "mydb on
>>> myuser@myserver:port ~myrole" the role would be set as advertised. But
>>> that's not how it works. (And I am not saying it should.)
>>> I don't have a strong opinion here. My reasoning is this:
>>> - pgAdmin is getting increasingly complex.
>>> - Therefore, if a feature is of limited use while introducing chances
>>> for errors and misunderstandings, we should consider not having it at
>>> all.
>>> If there is use cases where the feature helps a lot, my reasoning is
>>> moot.
>>>
>>>
>>>>> 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@postgres=# create user toto;
>>>> CREATE ROLE
>>>> guillaume@postgres=# set role to toto;
>>>> SET
>>>> guillaume@postgres=>
>>>>
>>>> See the prompt? it doesn't say toto@postgres. 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.
>>> To be precise: up to 1.12 the "Database bar" only displays information
>>> about the _connection_. This is always true, even after SET ROLE.
>>> So does psql.
>>> In 1.14 information about the _active role_ is added. But this can be
>>> false.
>> So, one solution would be to get rid of the role name in the connection
>> combo box. Would you be happy with that solution?
>
> I have given it some thought over the weekend, but there is no clean way
> around it. If the active role is advertised in the connection bar, then
> it should be the _actually_ active role. Therefore, your proposal to
> fire "select current_user;" after every executed piece of code is the
> proper way. (You would not do that for connections that have been
> started without SET ROLE.)
> (I would still drop the feature. It adds complexity and I don't see the
> need.)
>
> Not displaying the active role might be a compromise to avoid the
> overhead as well as false advertising.
> But then: how to distinguish between several connections? You keep them
> in the order of their appearance, but most people will not realize that.
> Also I am not sure if that is guaranteed. How about assigning sequential
> numbers? Does not need much space and would help to identify /
> distinguish connections - epecially if the connection string gets
> truncated or if one opens multiple connections to the same DB.
>
>     1: mydb on myuser@myserver:port
>     2: myotherdb on myuser@myotherserver:port
>     3: mydb on myuser@myserver:port
>

So, I finally did some fixes:

* "Database bar" has been renamed to "Connection bar".
* The connection bar is larger. (check if it is enough, it's quite hard
  to be sure of it)
* The connection name doesn't contain the rolename.


--
Guillaume
 http://www.postgresql.fr
 http://dalibo.com

Re: Database bar

From
Erwin Brandstetter
Date:
On 28.05.2011 15:56, Guillaume Lelarge wrote:
> On 05/09/2011 07:17 PM, Erwin Brandstetter wrote:
>> On 06.05.2011 23:40, Guillaume Lelarge wrote:
>>> On 05/06/2011 04:27 PM, Erwin Brandstetter wrote:
>>>> Hi Guillaume!
>>>>
>>>> On 05.05.2011 22:50, Guillaume Lelarge wrote:
>>>>> On 05/05/2011 05:25 PM, Erwin Brandstetter wrote:
>>>>> (...)
>>>>>> Changing to another connection and changing back does not change the
>>>>>> situation.
>>>>> Meaning?
>>>> One might expect, that by chosing a connection named "mydb on
>>>> myuser@myserver:port ~myrole" the role would be set as advertised. But
>>>> that's not how it works. (And I am not saying it should.)
>>>> I don't have a strong opinion here. My reasoning is this:
>>>> - pgAdmin is getting increasingly complex.
>>>> - Therefore, if a feature is of limited use while introducing chances
>>>> for errors and misunderstandings, we should consider not having it at
>>>> all.
>>>> If there is use cases where the feature helps a lot, my reasoning is
>>>> moot.
>>>>
>>>>
>>>>>> 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@postgres=# create user toto;
>>>>> CREATE ROLE
>>>>> guillaume@postgres=# set role to toto;
>>>>> SET
>>>>> guillaume@postgres=>
>>>>>
>>>>> See the prompt? it doesn't say toto@postgres. 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.
>>>> To be precise: up to 1.12 the "Database bar" only displays information
>>>> about the _connection_. This is always true, even after SET ROLE.
>>>> So does psql.
>>>> In 1.14 information about the _active role_ is added. But this can be
>>>> false.
>>> So, one solution would be to get rid of the role name in the connection
>>> combo box. Would you be happy with that solution?
>> I have given it some thought over the weekend, but there is no clean way
>> around it. If the active role is advertised in the connection bar, then
>> it should be the _actually_ active role. Therefore, your proposal to
>> fire "select current_user;" after every executed piece of code is the
>> proper way. (You would not do that for connections that have been
>> started without SET ROLE.)
>> (I would still drop the feature. It adds complexity and I don't see the
>> need.)
>>
>> Not displaying the active role might be a compromise to avoid the
>> overhead as well as false advertising.
>> But then: how to distinguish between several connections? You keep them
>> in the order of their appearance, but most people will not realize that.
>> Also I am not sure if that is guaranteed. How about assigning sequential
>> numbers? Does not need much space and would help to identify /
>> distinguish connections - epecially if the connection string gets
>> truncated or if one opens multiple connections to the same DB.
>>
>>      1: mydb on myuser@myserver:port
>>      2: myotherdb on myuser@myotherserver:port
>>      3: mydb on myuser@myserver:port
>>
> So, I finally did some fixes:
>
> * "Database bar" has been renamed to "Connection bar".
> * The connection bar is larger. (check if it is enough, it's quite hard
>    to be sure of it)
> * The connection name doesn't contain the rolename.


I tried the new 1.14 beta2 on Win XP today.
"Connection bar" has arrived.
But the control is exactly the same size as it was in 1.12.3. The growth
got lost somehow?

Did not notice any other problems so far, but I have not tested much yet.

Regards
Erwin

Re: Database bar

From
Guillaume Lelarge
Date:
On Sat, 2011-06-11 at 16:02 +0200, Erwin Brandstetter wrote:
> On 28.05.2011 15:56, Guillaume Lelarge wrote:
> > On 05/09/2011 07:17 PM, Erwin Brandstetter wrote:
> >> On 06.05.2011 23:40, Guillaume Lelarge wrote:
> >>> On 05/06/2011 04:27 PM, Erwin Brandstetter wrote:
> >>>> Hi Guillaume!
> >>>>
> >>>> On 05.05.2011 22:50, Guillaume Lelarge wrote:
> >>>>> On 05/05/2011 05:25 PM, Erwin Brandstetter wrote:
> >>>>> (...)
> >>>>>> Changing to another connection and changing back does not change the
> >>>>>> situation.
> >>>>> Meaning?
> >>>> One might expect, that by chosing a connection named "mydb on
> >>>> myuser@myserver:port ~myrole" the role would be set as advertised. But
> >>>> that's not how it works. (And I am not saying it should.)
> >>>> I don't have a strong opinion here. My reasoning is this:
> >>>> - pgAdmin is getting increasingly complex.
> >>>> - Therefore, if a feature is of limited use while introducing chances
> >>>> for errors and misunderstandings, we should consider not having it at
> >>>> all.
> >>>> If there is use cases where the feature helps a lot, my reasoning is
> >>>> moot.
> >>>>
> >>>>
> >>>>>> 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@postgres=# create user toto;
> >>>>> CREATE ROLE
> >>>>> guillaume@postgres=# set role to toto;
> >>>>> SET
> >>>>> guillaume@postgres=>
> >>>>>
> >>>>> See the prompt? it doesn't say toto@postgres. 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.
> >>>> To be precise: up to 1.12 the "Database bar" only displays information
> >>>> about the _connection_. This is always true, even after SET ROLE.
> >>>> So does psql.
> >>>> In 1.14 information about the _active role_ is added. But this can be
> >>>> false.
> >>> So, one solution would be to get rid of the role name in the connection
> >>> combo box. Would you be happy with that solution?
> >> I have given it some thought over the weekend, but there is no clean way
> >> around it. If the active role is advertised in the connection bar, then
> >> it should be the _actually_ active role. Therefore, your proposal to
> >> fire "select current_user;" after every executed piece of code is the
> >> proper way. (You would not do that for connections that have been
> >> started without SET ROLE.)
> >> (I would still drop the feature. It adds complexity and I don't see the
> >> need.)
> >>
> >> Not displaying the active role might be a compromise to avoid the
> >> overhead as well as false advertising.
> >> But then: how to distinguish between several connections? You keep them
> >> in the order of their appearance, but most people will not realize that.
> >> Also I am not sure if that is guaranteed. How about assigning sequential
> >> numbers? Does not need much space and would help to identify /
> >> distinguish connections - epecially if the connection string gets
> >> truncated or if one opens multiple connections to the same DB.
> >>
> >>      1: mydb on myuser@myserver:port
> >>      2: myotherdb on myuser@myotherserver:port
> >>      3: mydb on myuser@myserver:port
> >>
> > So, I finally did some fixes:
> >
> > * "Database bar" has been renamed to "Connection bar".
> > * The connection bar is larger. (check if it is enough, it's quite hard
> >    to be sure of it)
> > * The connection name doesn't contain the rolename.
>
>
> I tried the new 1.14 beta2 on Win XP today.
> "Connection bar" has arrived.
> But the control is exactly the same size as it was in 1.12.3. The growth
> got lost somehow?
>

Strange. Can you check your Perspective setting in the frmQuery group?
Empty it and relaunch pgAdmin.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


Re: Database bar

From
Erwin Brandstetter
Date:
On 11.06.2011 18:16, Guillaume Lelarge wrote:
> On Sat, 2011-06-11 at 18:13 +0200, Erwin Brandstetter wrote:
>> On 11.06.2011 17:17, Guillaume Lelarge wrote:
>>> On Sat, 2011-06-11 at 16:02 +0200, Erwin Brandstetter wrote:
>>>> On 28.05.2011 15:56, Guillaume Lelarge wrote:
(...)
>>>>> So, I finally did some fixes:
>>>>>
>>>>> * "Database bar" has been renamed to "Connection bar".
>>>>> * The connection bar is larger. (check if it is enough, it's quite hard
>>>>>      to be sure of it)
>>>>> * The connection name doesn't contain the rolename.
>>>> I tried the new 1.14 beta2 on Win XP today.
>>>> "Connection bar" has arrived.
>>>> But the control is exactly the same size as it was in 1.12.3. The growth
>>>> got lost somehow?
>>>>
>>> Strange. Can you check your Perspective setting in the frmQuery group?
>>> Empty it and relaunch pgAdmin.
>> Sorry, I don't know what that means.
>> Are you referring to the source code? I have only donwnloaded the
>> provided binary ...
>>
> I think you don't have the new size because the old one is recorded in
> your preferences. On Windows, it's stored in the registry. Can you look
> with regedit, find the Perspective value of the frmQuery group, and
> delete it?
>
> If you've never used regedit, it's probably better not to.

Ah, registry settings.
Most people will update from a previous version and run into the same
problem ..

I have 12 entries named perspective-.* I attached the names and values
for the first and last one. Which am I supposed to delete? All of them?
These values are just to remember the previous state of the GUI, I am
not losing other settings, right?
In case this should be relevant: I have installed pgAdmin  1.10, 1.12,
and 1.14 in parallel on the PC in question.

What's confusing: the size of the connection bar cannot be adjusted in
any way, so why save it to the registry?


Regards
Erwin

-- My registry settings in HKEY_CURRENT_USER\Software\pgAdmin III\frmQuery
...
Perspective-
layout2|name=toolBar;caption=Tool

bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=415;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Database


bar;state=16788208;dir=1;layer=10;row=0;pos=426;prop=100000;bestw=250;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=696;floaty=266;floatw=267;floath=49|name=outputPane;caption=Output


pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch


pad;state=16779262;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL


query;state=1020;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=202|dock_size(3,0,0)=300|

Perspective-6329
Perspective-6405
Perspective-6458
Perspective-6552
Perspective-6930
Perspective-7127
Perspective-7181
Perspective-7945
Perspective-8187
Perspective-8269

Perspective-8316
layout2|name=toolBar;caption=Tool

bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=415;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Database


bar;state=16788208;dir=1;layer=10;row=0;pos=426;prop=100000;bestw=250;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=570;floaty=249;floatw=267;floath=49|name=outputPane;caption=Output


pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch


pad;state=16779262;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL


query;state=1020;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=202|dock_size(3,0,0)=430|

Re: Database bar

From
Guillaume Lelarge
Date:
On Sat, 2011-06-11 at 22:24 +0200, Erwin Brandstetter wrote:
> On 11.06.2011 18:16, Guillaume Lelarge wrote:
> > On Sat, 2011-06-11 at 18:13 +0200, Erwin Brandstetter wrote:
> >> On 11.06.2011 17:17, Guillaume Lelarge wrote:
> >>> On Sat, 2011-06-11 at 16:02 +0200, Erwin Brandstetter wrote:
> >>>> On 28.05.2011 15:56, Guillaume Lelarge wrote:
> (...)
> >>>>> So, I finally did some fixes:
> >>>>>
> >>>>> * "Database bar" has been renamed to "Connection bar".
> >>>>> * The connection bar is larger. (check if it is enough, it's quite hard
> >>>>>      to be sure of it)
> >>>>> * The connection name doesn't contain the rolename.
> >>>> I tried the new 1.14 beta2 on Win XP today.
> >>>> "Connection bar" has arrived.
> >>>> But the control is exactly the same size as it was in 1.12.3. The growth
> >>>> got lost somehow?
> >>>>
> >>> Strange. Can you check your Perspective setting in the frmQuery group?
> >>> Empty it and relaunch pgAdmin.
> >> Sorry, I don't know what that means.
> >> Are you referring to the source code? I have only donwnloaded the
> >> provided binary ...
> >>
> > I think you don't have the new size because the old one is recorded in
> > your preferences. On Windows, it's stored in the registry. Can you look
> > with regedit, find the Perspective value of the frmQuery group, and
> > delete it?
> >
> > If you've never used regedit, it's probably better not to.
>
> Ah, registry settings.
> Most people will update from a previous version and run into the same
> problem ..
>

I know that. It seems I forgot to increment the perspective number. But
I won't do only that if the rest is wrong too.

> I have 12 entries named perspective-.* I attached the names and values
> for the first and last one. Which am I supposed to delete? All of them?

All of them would be better, but you can only delete the 8316 one.

> These values are just to remember the previous state of the GUI, I am
> not losing other settings, right?

The perspective is only for location, and size of the different panes.
In the frmQuery group, it only refers to the query tool.

> In case this should be relevant: I have installed pgAdmin  1.10, 1.12,
> and 1.14 in parallel on the PC in question.
>

That should not be an issue. They all have a different perspective name
(hence, the perspective-<number>). In this case, just drop the
perspective-8316.

> What's confusing: the size of the connection bar cannot be adjusted in
> any way, so why save it to the registry?

The perspective is a whole. Either you save all locations, and sizes of
the panes of this window, or you save nothing. At least, that was the
case when I last read the wxWidgets documentation.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


Re: Database bar

From
Erwin Brandstetter
Date:
On 12.06.2011 08:59, Guillaume Lelarge wrote:
> On Sat, 2011-06-11 at 22:24 +0200, Erwin Brandstetter wrote:
>> On 11.06.2011 18:16, Guillaume Lelarge wrote:
>>> On Sat, 2011-06-11 at 18:13 +0200, Erwin Brandstetter wrote:
>>>> On 11.06.2011 17:17, Guillaume Lelarge wrote:
>>>>> On Sat, 2011-06-11 at 16:02 +0200, Erwin Brandstetter wrote:
>>>>>> On 28.05.2011 15:56, Guillaume Lelarge wrote:
>> (...)
>>>>>>> So, I finally did some fixes:
>>>>>>>
>>>>>>> * "Database bar" has been renamed to "Connection bar".
>>>>>>> * The connection bar is larger. (check if it is enough, it's quite hard
>>>>>>>       to be sure of it)
>>>>>>> * The connection name doesn't contain the rolename.
>>>>>> I tried the new 1.14 beta2 on Win XP today.
>>>>>> "Connection bar" has arrived.
>>>>>> But the control is exactly the same size as it was in 1.12.3. The growth
>>>>>> got lost somehow?
>>>>>>
>>>>> Strange. Can you check your Perspective setting in the frmQuery group?
>>>>> Empty it and relaunch pgAdmin.
>>>> Sorry, I don't know what that means.
>>>> Are you referring to the source code? I have only donwnloaded the
>>>> provided binary ...
>>>>
>>> I think you don't have the new size because the old one is recorded in
>>> your preferences. On Windows, it's stored in the registry. Can you look
>>> with regedit, find the Perspective value of the frmQuery group, and
>>> delete it?
>>>
>>> If you've never used regedit, it's probably better not to.
>> Ah, registry settings.
>> Most people will update from a previous version and run into the same
>> problem ..
>>
> I know that. It seems I forgot to increment the perspective number. But
> I won't do only that if the rest is wrong too.
>
>> I have 12 entries named perspective-.* I attached the names and values
>> for the first and last one. Which am I supposed to delete? All of them?
> All of them would be better, but you can only delete the 8316 one.
>
>> These values are just to remember the previous state of the GUI, I am
>> not losing other settings, right?
> The perspective is only for location, and size of the different panes.
> In the frmQuery group, it only refers to the query tool.
>
>> In case this should be relevant: I have installed pgAdmin  1.10, 1.12,
>> and 1.14 in parallel on the PC in question.
>>
> That should not be an issue. They all have a different perspective name
> (hence, the perspective-<number>). In this case, just drop the
> perspective-8316.
>
>> What's confusing: the size of the connection bar cannot be adjusted in
>> any way, so why save it to the registry?
> The perspective is a whole. Either you save all locations, and sizes of
> the panes of this window, or you save nothing. At least, that was the
> case when I last read the wxWidgets documentation.


Your theory is probably right. After deleting all "Perspective-*"
entries from the registry, the Connection bar is now broader. The new
size works just fine.
BTW: would it be an option to let the user adjust the size or even
auto-adjust to the longest entry? (Just ideas.)
After closing pgAdmin a new entry "perspective-8316" landed in the
registry. I paste it here, in case you should need it.
Those should be vanilla values, I only checked on the size of the
Connection bar and did not make any adjustments.

layout2|name=toolBar;caption=Tool

bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=415;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Connection


bar;state=16788208;dir=1;layer=10;row=0;pos=426;prop=100000;bestw=300;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output


pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch


pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL


query;state=1020;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=202|dock_size(3,0,0)=290|dock_size(2,0,0)=255|


Regards
Erwin



Re: Database bar

From
Guillaume Lelarge
Date:
On Mon, 2011-06-13 at 00:36 +0200, Erwin Brandstetter wrote:
> On 12.06.2011 08:59, Guillaume Lelarge wrote:
> > On Sat, 2011-06-11 at 22:24 +0200, Erwin Brandstetter wrote:
> >> On 11.06.2011 18:16, Guillaume Lelarge wrote:
> >>> On Sat, 2011-06-11 at 18:13 +0200, Erwin Brandstetter wrote:
> >>>> On 11.06.2011 17:17, Guillaume Lelarge wrote:
> >>>>> On Sat, 2011-06-11 at 16:02 +0200, Erwin Brandstetter wrote:
> >>>>>> On 28.05.2011 15:56, Guillaume Lelarge wrote:
> >> (...)
> >>>>>>> So, I finally did some fixes:
> >>>>>>>
> >>>>>>> * "Database bar" has been renamed to "Connection bar".
> >>>>>>> * The connection bar is larger. (check if it is enough, it's quite hard
> >>>>>>>       to be sure of it)
> >>>>>>> * The connection name doesn't contain the rolename.
> >>>>>> I tried the new 1.14 beta2 on Win XP today.
> >>>>>> "Connection bar" has arrived.
> >>>>>> But the control is exactly the same size as it was in 1.12.3. The growth
> >>>>>> got lost somehow?
> >>>>>>
> >>>>> Strange. Can you check your Perspective setting in the frmQuery group?
> >>>>> Empty it and relaunch pgAdmin.
> >>>> Sorry, I don't know what that means.
> >>>> Are you referring to the source code? I have only donwnloaded the
> >>>> provided binary ...
> >>>>
> >>> I think you don't have the new size because the old one is recorded in
> >>> your preferences. On Windows, it's stored in the registry. Can you look
> >>> with regedit, find the Perspective value of the frmQuery group, and
> >>> delete it?
> >>>
> >>> If you've never used regedit, it's probably better not to.
> >> Ah, registry settings.
> >> Most people will update from a previous version and run into the same
> >> problem ..
> >>
> > I know that. It seems I forgot to increment the perspective number. But
> > I won't do only that if the rest is wrong too.
> >
> >> I have 12 entries named perspective-.* I attached the names and values
> >> for the first and last one. Which am I supposed to delete? All of them?
> > All of them would be better, but you can only delete the 8316 one.
> >
> >> These values are just to remember the previous state of the GUI, I am
> >> not losing other settings, right?
> > The perspective is only for location, and size of the different panes.
> > In the frmQuery group, it only refers to the query tool.
> >
> >> In case this should be relevant: I have installed pgAdmin  1.10, 1.12,
> >> and 1.14 in parallel on the PC in question.
> >>
> > That should not be an issue. They all have a different perspective name
> > (hence, the perspective-<number>). In this case, just drop the
> > perspective-8316.
> >
> >> What's confusing: the size of the connection bar cannot be adjusted in
> >> any way, so why save it to the registry?
> > The perspective is a whole. Either you save all locations, and sizes of
> > the panes of this window, or you save nothing. At least, that was the
> > case when I last read the wxWidgets documentation.
>
>
> Your theory is probably right. After deleting all "Perspective-*"
> entries from the registry, the Connection bar is now broader. The new
> size works just fine.

OK, I've commited a patch with an increment on the perspective number.
Thanks.

> BTW: would it be an option to let the user adjust the size or even
> auto-adjust to the longest entry? (Just ideas.)

Don't know if it's possible at all.

> After closing pgAdmin a new entry "perspective-8316" landed in the
> registry. I paste it here, in case you should need it.
> Those should be vanilla values, I only checked on the size of the
> Connection bar and did not make any adjustments.
>
> layout2|name=toolBar;caption=Tool
>
bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=415;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Connection

>
bar;state=16788208;dir=1;layer=10;row=0;pos=426;prop=100000;bestw=300;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output

>
pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch

>
pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL

>
query;state=1020;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=202|dock_size(3,0,0)=290|dock_size(2,0,0)=255|
>

That's the good new perspective. bestw's value is now 300 for the
database bar.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com


Re: Database bar

From
Erwin Brandstetter
Date:
On 13.06.2011 14:56, Guillaume Lelarge wrote:
> On Mon, 2011-06-13 at 00:36 +0200, Erwin Brandstetter wrote:
>> On 12.06.2011 08:59, Guillaume Lelarge wrote:
>>> On Sat, 2011-06-11 at 22:24 +0200, Erwin Brandstetter wrote:
>>>
(...)

>> After closing pgAdmin a new entry "perspective-8316" landed in the
>> registry. I paste it here, in case you should need it.
>> Those should be vanilla values, I only checked on the size of the
>> Connection bar and did not make any adjustments.
>>
>> layout2|name=toolBar;caption=Tool
>>
bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=415;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Connection
>>
bar;state=16788208;dir=1;layer=10;row=0;pos=426;prop=100000;bestw=300;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output
>>
pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch
>>
pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL
>>
query;state=1020;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=202|dock_size(3,0,0)=290|dock_size(2,0,0)=255|
>>
> That's the good new perspective. bestw's value is now 300 for the
> database bar.

One more thing ..
     name=databaseBar;    caption=Connection bar;

I would keep name and caption in sync to avoid future confusion (if
possible) ->  name=connectionBar


Regards
Erwin


Re: Database bar

From
Guillaume Lelarge
Date:
On Mon, 2011-06-13 at 15:13 +0200, Erwin Brandstetter wrote:
> On 13.06.2011 14:56, Guillaume Lelarge wrote:
> > On Mon, 2011-06-13 at 00:36 +0200, Erwin Brandstetter wrote:
> >> On 12.06.2011 08:59, Guillaume Lelarge wrote:
> >>> On Sat, 2011-06-11 at 22:24 +0200, Erwin Brandstetter wrote:
> >>>
> (...)
>
> >> After closing pgAdmin a new entry "perspective-8316" landed in the
> >> registry. I paste it here, in case you should need it.
> >> Those should be vanilla values, I only checked on the size of the
> >> Connection bar and did not make any adjustments.
> >>
> >> layout2|name=toolBar;caption=Tool
> >>
bar;state=16788208;dir=1;layer=10;row=0;pos=0;prop=100000;bestw=415;besth=23;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=databaseBar;caption=Connection
> >>
bar;state=16788208;dir=1;layer=10;row=0;pos=426;prop=100000;bestw=300;besth=21;minw=-1;minh=-1;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=outputPane;caption=Output
> >>
pane;state=16779260;dir=3;layer=0;row=0;pos=0;prop=100000;bestw=550;besth=300;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=scratchPad;caption=Scratch
> >>
pad;state=16779260;dir=2;layer=0;row=0;pos=0;prop=100000;bestw=250;besth=200;minw=100;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|name=sqlQuery;caption=SQL
> >>
query;state=1020;dir=5;layer=0;row=0;pos=0;prop=100000;bestw=350;besth=200;minw=200;minh=100;maxw=-1;maxh=-1;floatx=-1;floaty=-1;floatw=-1;floath=-1|dock_size(1,10,0)=25|dock_size(5,0,0)=202|dock_size(3,0,0)=290|dock_size(2,0,0)=255|
> >>
> > That's the good new perspective. bestw's value is now 300 for the
> > database bar.
>
> One more thing ..
>      name=databaseBar;    caption=Connection bar;
>
> I would keep name and caption in sync to avoid future confusion (if
> possible) ->  name=connectionBar
>

Yeah, it would be better. And change all databasebar variables to
connectionbar variables. Not sure I want to do this while in beta.


--
Guillaume
  http://blog.guillaume.lelarge.info
  http://www.dalibo.com