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

Re: User mapping

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Thom Brown <thom(at)linux(dot)com>
Cc: pgadmin-hackers(at)postgresql(dot)org
Subject: Re: User mapping
Date: 2011-03-23 23:00:23
Message-ID: 4D8A7B87.6040008@lelarge.info (view raw or flat)
Thread:
Lists: pgadmin-hackers
Le 23/03/2011 23:39, Thom Brown a écrit :
> On 23 March 2011 22:10, Guillaume Lelarge <guillaume(at)lelarge(dot)info> wrote:
>> Hi,
>>
>> I'm looking at adding user mapping support. My first idea was to add
>> them as children of foreign servers, but it doesn't seem this was a
>> really good idea. They have no OIDs, no owners, no comments... geez, no
>> nothing actually. They don't seem like objects, meaning they can't be in
>> their own node (with no OID, refresh wouldn't work for example).
>>
>> My second idea was to add a "User mapping" tab on the foreign server
>> dialog, so that we could directly add user mapping to servers. It still
>> seems a good idea to me.
>>
>> SQL commands are quite simple:
>>
>> CREATE USER MAPPING FOR { user_name | USER | CURRENT_USER | PUBLIC }
>>    SERVER server_name
>>    [ OPTIONS ( option 'value' [ , ... ] ) ]
>>
>> ALTER USER MAPPING FOR { user_name | USER | CURRENT_USER | PUBLIC }
>>    SERVER server_name
>>    OPTIONS ( [ ADD | SET | DROP ] option ['value'] [, ... ] )
>>
>> DROP USER MAPPING [ IF EXISTS ] FOR { user_name | USER | CURRENT_USER |
>> PUBLIC } SERVER server_name
>>
>> There's something that bugs me right now: the OPTIONS clause. Can't
>> think of a good UI for it.
> 
> Why not something similar what exists for database variables?  i.e.
> option=>value.
> 

Yeah, good idea. I like it. But I'm not sure it would work well.

> As for having them as child nodes of a foreign server, I think that
> would work well.  Each node member would be a user, and wouldn't the
> oid from pg_user_mapping be available to display in the properties.
> You'd then have oid and options.  Granted it looks very minimalistic,
> but then I think it's more intuitive.
> 

You probably don't need the OID to display the properties dialog. But
you need a unique way to identify a user. The pair username/foreign
server could be it.

I agree that nodes would be more intuitive. But I'm not sure it really
makes sense (or is consistent with the rest of the UI).


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

In response to

pgadmin-hackers by date

Next:From: TimonDate: 2011-03-24 06:21:21
Subject: gin/gist indexes show twice
Previous:From: Thom BrownDate: 2011-03-23 22:39:09
Subject: Re: User mapping

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