Thread: How do I configure pgAdmin to ask for username when connecting to a server?

How do I configure pgAdmin to ask for username when connecting to a server?

From
Roger Demetrescu
Date:
Hello all,

When registering a new server in pgAdmin, the field Username is
required. The problem is I have several databases in my servers, each
one with its own owner.
So, if I need to connect to customer1_db, I have to change the
properties of Username at the server configuration to 'customer1'.
When I need to connect to customer2_db, I have to change username to
'customer2', and so on...

Is there any way to force pgAdmin to ask for username AND password
just before I connect to the server? IMHO it is more practical than
the current approach I am forced to follow.

Maybe I am missing something here, so any advice would be very appreciated.

I am using pgAdmin 1.12.1 on Ubuntu.

TIA,

Roger


Re: How do I configure pgAdmin to ask for username when connecting to a server?

From
Guillaume Lelarge
Date:
Le 22/03/2011 13:14, Roger Demetrescu a écrit :
> [...]
> When registering a new server in pgAdmin, the field Username is
> required. The problem is I have several databases in my servers, each
> one with its own owner.
> So, if I need to connect to customer1_db, I have to change the
> properties of Username at the server configuration to 'customer1'.
> When I need to connect to customer2_db, I have to change username to
> 'customer2', and so on...
> 
> Is there any way to force pgAdmin to ask for username AND password
> just before I connect to the server? IMHO it is more practical than
> the current approach I am forced to follow.
> 
> Maybe I am missing something here, so any advice would be very appreciated.
> 

You can't right now. But I agree that this is something I would like to
have too (mostly for testing purpose). And it feels more pratical this way.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com




On Tue, Mar 22, 2011 at 12:28 PM, Guillaume Lelarge <guillaume@lelarge.info> wrote:
Le 22/03/2011 13:14, Roger Demetrescu a écrit :
> [...]
> When registering a new server in pgAdmin, the field Username is
> required. The problem is I have several databases in my servers, each
> one with its own owner.
> So, if I need to connect to customer1_db, I have to change the
> properties of Username at the server configuration to 'customer1'.
> When I need to connect to customer2_db, I have to change username to
> 'customer2', and so on...
>
> Is there any way to force pgAdmin to ask for username AND password
> just before I connect to the server? IMHO it is more practical than
> the current approach I am forced to follow.
>
> Maybe I am missing something here, so any advice would be very appreciated.
>

You can't right now. But I agree that this is something I would like to
have too (mostly for testing purpose). And it feels more pratical this way.

If the username is specific to the database, then it doesn't make sense to ask for it when connecting to the server. What is required (I think) is the ability to specify a role for each database. It would be stored as a per-user setting alongside the schema restriction. 


--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: How do I configure pgAdmin to ask for username when connecting to a server?

From
Roger Demetrescu
Date:
On Tue, Mar 22, 2011 at 09:35, Dave Page <dpage@pgadmin.org> wrote:
>
>
> On Tue, Mar 22, 2011 at 12:28 PM, Guillaume Lelarge <guillaume@lelarge.info>
> wrote:
>>
>> Le 22/03/2011 13:14, Roger Demetrescu a écrit :
>> > [...]
>> > When registering a new server in pgAdmin, the field Username is
>> > required. The problem is I have several databases in my servers, each
>> > one with its own owner.
>> > So, if I need to connect to customer1_db, I have to change the
>> > properties of Username at the server configuration to 'customer1'.
>> > When I need to connect to customer2_db, I have to change username to
>> > 'customer2', and so on...
>> >
>> > Is there any way to force pgAdmin to ask for username AND password
>> > just before I connect to the server? IMHO it is more practical than
>> > the current approach I am forced to follow.
>> >
>> > Maybe I am missing something here, so any advice would be very
>> > appreciated.
>> >
>>
>> You can't right now. But I agree that this is something I would like to
>> have too (mostly for testing purpose). And it feels more pratical this
>> way.
>
> If the username is specific to the database, then it doesn't make sense to
> ask for it when connecting to the server. What is required (I think) is the
> ability to specify a role for each database. It would be stored as a
> per-user setting alongside the schema restriction.

But wouldn't that require me to connect to the server as 'postgres' ?
Otherwise how would you allow one to play as 'user2' in database2 if
he connected as 'user1' in the server ?

Anyway, I never heard about one been able to play multiples roles
using the same connection.

Cheers,

Roger




On Tue, Mar 22, 2011 at 1:21 PM, Roger Demetrescu <roger.demetrescu@gmail.com> wrote:
On Tue, Mar 22, 2011 at 09:35, Dave Page <dpage@pgadmin.org> wrote:
>
>
> On Tue, Mar 22, 2011 at 12:28 PM, Guillaume Lelarge <guillaume@lelarge.info>
> wrote:
>>
>> Le 22/03/2011 13:14, Roger Demetrescu a écrit :
>> > [...]
>> > When registering a new server in pgAdmin, the field Username is
>> > required. The problem is I have several databases in my servers, each
>> > one with its own owner.
>> > So, if I need to connect to customer1_db, I have to change the
>> > properties of Username at the server configuration to 'customer1'.
>> > When I need to connect to customer2_db, I have to change username to
>> > 'customer2', and so on...
>> >
>> > Is there any way to force pgAdmin to ask for username AND password
>> > just before I connect to the server? IMHO it is more practical than
>> > the current approach I am forced to follow.
>> >
>> > Maybe I am missing something here, so any advice would be very
>> > appreciated.
>> >
>>
>> You can't right now. But I agree that this is something I would like to
>> have too (mostly for testing purpose). And it feels more pratical this
>> way.
>
> If the username is specific to the database, then it doesn't make sense to
> ask for it when connecting to the server. What is required (I think) is the
> ability to specify a role for each database. It would be stored as a
> per-user setting alongside the schema restriction.

But wouldn't that require me to connect to the server as 'postgres' ?

No, it would require you to connect as one particular user, but not necessarily postgres.
 
Otherwise how would you allow one to play as 'user2' in database2 if
he connected as 'user1' in the server ?

By selecting a different role as I suggested. 

Anyway, I never heard about one been able to play multiples roles
using the same connection.


Different databases always have different connections. 

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: How do I configure pgAdmin to ask for username when connecting to a server?

From
Roger Demetrescu
Date:
On Tue, Mar 22, 2011 at 10:37, Dave Page <dpage@pgadmin.org> wrote:
>
>
> On Tue, Mar 22, 2011 at 1:21 PM, Roger Demetrescu
> <roger.demetrescu@gmail.com> wrote:
>>
>> On Tue, Mar 22, 2011 at 09:35, Dave Page <dpage@pgadmin.org> wrote:
>> >
>> >
>> > On Tue, Mar 22, 2011 at 12:28 PM, Guillaume Lelarge
>> > <guillaume@lelarge.info>
>> > wrote:
>> >>
>> >> Le 22/03/2011 13:14, Roger Demetrescu a écrit :
>> >> > [...]
>> >> > When registering a new server in pgAdmin, the field Username is
>> >> > required. The problem is I have several databases in my servers, each
>> >> > one with its own owner.
>> >> > So, if I need to connect to customer1_db, I have to change the
>> >> > properties of Username at the server configuration to 'customer1'.
>> >> > When I need to connect to customer2_db, I have to change username to
>> >> > 'customer2', and so on...
>> >> >
>> >> > Is there any way to force pgAdmin to ask for username AND password
>> >> > just before I connect to the server? IMHO it is more practical than
>> >> > the current approach I am forced to follow.
>> >> >
>> >> > Maybe I am missing something here, so any advice would be very
>> >> > appreciated.
>> >> >
>> >>
>> >> You can't right now. But I agree that this is something I would like to
>> >> have too (mostly for testing purpose). And it feels more pratical this
>> >> way.
>> >
>> > If the username is specific to the database, then it doesn't make sense
>> > to
>> > ask for it when connecting to the server. What is required (I think) is
>> > the
>> > ability to specify a role for each database. It would be stored as a
>> > per-user setting alongside the schema restriction.
>>
>> But wouldn't that require me to connect to the server as 'postgres' ?
>
> No, it would require you to connect as one particular user, but not
> necessarily postgres.
>
>>
>> Otherwise how would you allow one to play as 'user2' in database2 if
>> he connected as 'user1' in the server ?
>
> By selecting a different role as I suggested.
>>
>> Anyway, I never heard about one been able to play multiples roles
>> using the same connection.
>>
>
> Different databases always have different connections.

Ok, got it...

So, we could have one or more of the following possibilites:


1 - Allow blank username in server configuration. Whem emptied, the
username would be filled while connecting at at server.

2 - User the owner rule of a database to connect to it.
   (2a) Maybe a server configuration should exist to turn off this feature   (2b) Allow to connect to a database using
adifferent role (when 
the owner rule is not desired)


Whom should I talk to suggest those features in a future pgAdmin version ?


Thank you !!

Roger




On Tue, Mar 22, 2011 at 2:28 PM, Roger Demetrescu <roger.demetrescu@gmail.com> wrote:

So, we could have one or more of the following possibilites:


1 - Allow blank username in server configuration. Whem emptied, the
username would be filled while connecting at at server. 

2 - User the owner rule of a database to connect to it.

   (2a) Maybe a server configuration should exist to turn off this feature
   (2b) Allow to connect to a database using a different role (when
the owner rule is not desired)

Well, 2b is what I suggested.
 


Whom should I talk to suggest those features in a future pgAdmin version ?

 The guys you're already talking to.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Re: How do I configure pgAdmin to ask for username when connecting to a server?

From
Roger Demetrescu
Date:
On Tue, Mar 22, 2011 at 11:45, Dave Page <dpage@pgadmin.org> wrote:
>
>
> On Tue, Mar 22, 2011 at 2:28 PM, Roger Demetrescu
> <roger.demetrescu@gmail.com> wrote:
>>
>> So, we could have one or more of the following possibilites:
>>
>>
>> 1 - Allow blank username in server configuration. Whem emptied, the
>> username would be filled while connecting at at server.
>>
>> 2 - User the owner rule of a database to connect to it.
>>
>>    (2a) Maybe a server configuration should exist to turn off this feature
>>    (2b) Allow to connect to a database using a different role (when
>> the owner rule is not desired)
>
> Well, 2b is what I suggested.

Yep... I was just summarizing the ideias from this thread...   :)


>>
>> Whom should I talk to suggest those features in a future pgAdmin version ?
>
>  The guys you're already talking to.

Cool...

Thanks Dave and Guillaume,


Roger


Re: How do I configure pgAdmin to ask for username when connecting to a server?

From
Guillaume Lelarge
Date:
Le 22/03/2011 18:00, Roger Demetrescu a écrit :
> On Tue, Mar 22, 2011 at 11:45, Dave Page <dpage@pgadmin.org> wrote:
>>
>>
>> On Tue, Mar 22, 2011 at 2:28 PM, Roger Demetrescu
>> <roger.demetrescu@gmail.com> wrote:
>>>
>>> So, we could have one or more of the following possibilites:
>>>
>>>
>>> 1 - Allow blank username in server configuration. Whem emptied, the
>>> username would be filled while connecting at at server.
>>>
>>> 2 - User the owner rule of a database to connect to it.
>>>
>>>    (2a) Maybe a server configuration should exist to turn off this feature
>>>    (2b) Allow to connect to a database using a different role (when
>>> the owner rule is not desired)
>>
>> Well, 2b is what I suggested.
> 
> Yep... I was just summarizing the ideias from this thread...   :)
> 

We need at least 1, and 2b. Should be quite simple patches.

>>> Whom should I talk to suggest those features in a future pgAdmin version ?
>>
>>  The guys you're already talking to.
> 
> Cool...
> 
> Thanks Dave and Guillaume,
> 

Nothing's been done yet :)


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


Re: How do I configure pgAdmin to ask for username when connecting to a server?

From
Julius Tuskenis
Date:
Hello,

2011.03.23 00:47, Guillaume Lelarge rašė:
> 1 - Allow blank username in server configuration. Whem emptied, the
> >>>  username would be filled while connecting at at server.
May I suggest adding a username field to the "Connect to server" dialog 
and filling it from the server configuration? Usually the user will 
enter just the password as it is likely that the username in the server 
configuration will be the most often used one. Changing username would 
be easy too.

-- 
Julius Tuskenis
Programavimo skyriaus vadovas
UAB nSoft
mob. +37068233050



Re: How do I configure pgAdmin to ask for username when connecting to a server?

From
Guillaume Lelarge
Date:
Le 23/03/2011 08:20, Julius Tuskenis a écrit :
> Hello,
> 
> 2011.03.23 00:47, Guillaume Lelarge rašė:
>> 1 - Allow blank username in server configuration. Whem emptied, the
>> >>>  username would be filled while connecting at at server.
> May I suggest adding a username field to the "Connect to server" dialog
> and filling it from the server configuration? Usually the user will
> enter just the password as it is likely that the username in the server
> configuration will be the most often used one. Changing username would
> be easy too.
> 

Yeah, that's what I have in mind.


-- 
Guillaumehttp://www.postgresql.frhttp://dalibo.com


On Wed, Mar 23, 2011 at 5:38 PM, Guillaume Lelarge
<guillaume@lelarge.info> wrote:
> Le 23/03/2011 08:20, Julius Tuskenis a écrit :
>> Hello,
>>
>> 2011.03.23 00:47, Guillaume Lelarge rašė:
>>> 1 - Allow blank username in server configuration. Whem emptied, the
>>> >>>  username would be filled while connecting at at server.
>> May I suggest adding a username field to the "Connect to server" dialog
>> and filling it from the server configuration? Usually the user will
>> enter just the password as it is likely that the username in the server
>> configuration will be the most often used one. Changing username would
>> be easy too.
>>
>
> Yeah, that's what I have in mind.

That won't work well - that dialogue isn't shown if the user saves
their password.

--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company