Обсуждение: Change for connection name

Поиск
Список
Период
Сортировка

Change for connection name

От
Guillaume Lelarge
Дата:
Hi all,

I received an interesting request from Kevin Macdonald a few, hum,
months ago. Yes, I'm not really that quick :) But I didn't forget.

He wished to have the username on the query's window title. This is
interesting when you use multiple accounts. Currently, we have :
  Query - " + database_name + " on " + host + ":" + port

We wish to have instead :
  Query - " + database_name + " on " + user + "@" + host + ":" + port

The patch attached does exactly this. Comments ?

Regards.


--
Guillaume.
<!-- http://abs.traduc.org/
     http://lfs.traduc.org/
     http://docs.postgresqlfr.org/ -->
Index: pgadmin/db/pgConn.cpp
===================================================================
--- pgadmin/db/pgConn.cpp    (révision 6530)
+++ pgadmin/db/pgConn.cpp    (copie de travail)
@@ -434,7 +434,7 @@
     if (dbHost.IsEmpty())
         str.Printf(_("%s on local socket"), dbname.c_str());
     else
-        str.Printf(_("%s on %s:%d"), dbname.c_str(), dbHost.c_str(), GetPort());
+        str.Printf(_("%s on %s@%s:%d"), dbname.c_str(), GetUser().c_str(), dbHost.c_str(), GetPort());
     return str;
 }


Re: Change for connection name

От
Dave Page
Дата:
Guillaume Lelarge wrote:
> Hi all,
>
> I received an interesting request from Kevin Macdonald a few, hum,
> months ago. Yes, I'm not really that quick :) But I didn't forget.
>
> He wished to have the username on the query's window title. This is
> interesting when you use multiple accounts. Currently, we have :
>   Query - " + database_name + " on " + host + ":" + port
>
> We wish to have instead :
>   Query - " + database_name + " on " + user + "@" + host + ":" + port
>
> The patch attached does exactly this. Comments ?

Could use full URL style syntax perhaps (not sure if it looks too techy
though), eg:

dpage@svr.postgresql.org:5432/mydb

/D

Re: Change for connection name

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> Guillaume Lelarge wrote:
>> I received an interesting request from Kevin Macdonald a few, hum,
>> months ago. Yes, I'm not really that quick :) But I didn't forget.
>>
>> He wished to have the username on the query's window title. This is
>> interesting when you use multiple accounts. Currently, we have :
>>   Query - " + database_name + " on " + host + ":" + port
>>
>> We wish to have instead :
>>   Query - " + database_name + " on " + user + "@" + host + ":" + port
>>
>> The patch attached does exactly this. Comments ?
>
> Could use full URL style syntax perhaps (not sure if it looks too techy
> though), eg:
>
> dpage@svr.postgresql.org:5432/mydb
>

Currently, it is
  mydb on svr.postgresql.org:5432

My patch changes this to
  mydb on dpage@svr.postgresql.org:5432

So dpage@svr.postgresql.org:5432/mydb does not seem too techy for me.
Kevin, a comment ?


--
Guillaume.
<!-- http://abs.traduc.org/
     http://lfs.traduc.org/
     http://docs.postgresqlfr.org/ -->

Re: Change for connection name

От
Guillaume Lelarge
Дата:
Kevin Macdonald a écrit :
>> not sure if it looks too techy though
>
> I think so too; it's also a bit wordy. From my experience in an Oracle
> shop, few DBAs are programmer-type people.
>
> However, the choice could be controlled within "File->Options".
>

I don't think a choice is needed here. Moreover, it adds complexity and
this is not what we want on a beta phase.

> A simple alternative to the complexity would simply be
>
> "dpage@server_name" -- who you are, and what you connected to.
>
> where "server_name" is what you typed for "name" when you clicked on the
> "wall plug" and established a new server/connection.
>
> I think the low-level details (server URL, port, database) is too much;
> if a person wants these details, they can right-click on a server and
> choose "Properties..."
>

We need the database name "detail" because the server name doesn't imply
it. And using server name is great if you don't change it. I think we
really need every details, URL form or "verbose" form.


--
Guillaume.
<!-- http://abs.traduc.org/
     http://lfs.traduc.org/
     http://docs.postgresqlfr.org/ -->

Re: Change for connection name

От
Dave Page
Дата:
Guillaume Lelarge wrote:
> Kevin Macdonald a écrit :
>>> not sure if it looks too techy though
>> I think so too; it's also a bit wordy. From my experience in an Oracle
>> shop, few DBAs are programmer-type people.
>>
>> However, the choice could be controlled within "File->Options".
>>
>
> I don't think a choice is needed here. Moreover, it adds complexity and
> this is not what we want on a beta phase.
>
>> A simple alternative to the complexity would simply be
>>
>> "dpage@server_name" -- who you are, and what you connected to.
>>
>> where "server_name" is what you typed for "name" when you clicked on the
>> "wall plug" and established a new server/connection.
>>
>> I think the low-level details (server URL, port, database) is too much;
>> if a person wants these details, they can right-click on a server and
>> choose "Properties..."
>>
>
> We need the database name "detail" because the server name doesn't imply
> it. And using server name is great if you don't change it. I think we
> really need every details, URL form or "verbose" form.
>
>

Let's just use the form you proposed originally - I'll crawl back in my
hole and stop making silly suggestions :-)

/D

Re: Change for connection name

От
Guillaume Lelarge
Дата:
Dave Page a écrit :
> Guillaume Lelarge wrote:
>> Kevin Macdonald a écrit :
>>>> not sure if it looks too techy though
>>> I think so too; it's also a bit wordy. From my experience in an Oracle
>>> shop, few DBAs are programmer-type people.
>>>
>>> However, the choice could be controlled within "File->Options".
>>>
>> I don't think a choice is needed here. Moreover, it adds complexity and
>> this is not what we want on a beta phase.
>>
>>> A simple alternative to the complexity would simply be
>>>
>>> "dpage@server_name" -- who you are, and what you connected to.
>>>
>>> where "server_name" is what you typed for "name" when you clicked on the
>>> "wall plug" and established a new server/connection.
>>>
>>> I think the low-level details (server URL, port, database) is too much;
>>> if a person wants these details, they can right-click on a server and
>>> choose "Properties..."
>>>
>> We need the database name "detail" because the server name doesn't imply
>> it. And using server name is great if you don't change it. I think we
>> really need every details, URL form or "verbose" form.
>>
>>
>
> Let's just use the form you proposed originally - I'll crawl back in my
> hole and stop making silly suggestions :-)
>

Done.

I like having suggestions and ideas :)


--
Guillaume.
<!-- http://abs.traduc.org/
     http://lfs.traduc.org/
     http://docs.postgresqlfr.org/ -->

Re: Change for connection name

От
"Florian G. Pflug"
Дата:
Guillaume Lelarge wrote:
> Dave Page a écrit :
>> Guillaume Lelarge wrote:
>>> I received an interesting request from Kevin Macdonald a few, hum,
>>> months ago. Yes, I'm not really that quick :) But I didn't forget.
>>>
>>> He wished to have the username on the query's window title. This is
>>> interesting when you use multiple accounts. Currently, we have :
>>>   Query - " + database_name + " on " + host + ":" + port
>>>
>>> We wish to have instead :
>>>   Query - " + database_name + " on " + user + "@" + host + ":" + port
>>>
>>> The patch attached does exactly this. Comments ?
>> Could use full URL style syntax perhaps (not sure if it looks too techy
>> though), eg:
>>
>> dpage@svr.postgresql.org:5432/mydb
>>
>
> Currently, it is
>   mydb on svr.postgresql.org:5432
>
> My patch changes this to
>   mydb on dpage@svr.postgresql.org:5432
>
> So dpage@svr.postgresql.org:5432/mydb does not seem too techy for me.

Not that it really matters - but I think "db on user@host:5432" is half-way
between the full url form, and something more sentence-like, e.g.
"db on host:5432 as user". To me "db on user@user:port" opens the question
"why seperate out the db, and stuff the rest into a string".

Having said that, I'll go, shut up, and do real work again :-)

greetings, Florian Pflug


Re: Change for connection name

От
Erwin Brandstetter
Дата:
On Aug 2, 11:36 pm, guilla...@lelarge.info (Guillaume Lelarge) wrote:
> Dave Page a �crit :
>
(...)
> > Let's just use the form you proposed originally - I'll crawl back in my
> > hole and stop making silly suggestions :-)
>
> Done.

With the more informative connection name (which is a welcome
improvement), we should also increase the width of the database bar in
its docked state (or let the user adjust it). What good is all the
info, if one can't see it? ;)
Something simple like "tester on postgres@123.12.123.123:5432" is cut
off in the middle of the IP.
Tested in beta 3 on Win XP.

Regards
Erwin


Re: Change for connection name

От
Dave Page
Дата:
Erwin Brandstetter wrote:
> On Aug 2, 11:36 pm, guilla...@lelarge.info (Guillaume Lelarge) wrote:
>> Dave Page a écrit :
>>
> (...)
>>> Let's just use the form you proposed originally - I'll crawl back in my
>>> hole and stop making silly suggestions :-)
>> Done.
>
> With the more informative connection name (which is a welcome
> improvement), we should also increase the width of the database bar in
> its docked state (or let the user adjust it). What good is all the
> info, if one can't see it? ;)
> Something simple like "tester on postgres@123.12.123.123:5432" is cut
> off in the middle of the IP.
> Tested in beta 3 on Win XP.

Tweaked appropriately.

Thanks, Dave.