Re: db_user_namespace a "temporary measure"

Поиск
Список
Период
Сортировка
От Andrew Dunstan
Тема Re: db_user_namespace a "temporary measure"
Дата
Msg-id 531FD261.6010307@dunslane.net
обсуждение исходный текст
Ответ на Re: db_user_namespace a "temporary measure"  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On 03/11/2014 11:06 PM, Tom Lane wrote:
> Andrew Dunstan <andrew@dunslane.net> writes:
>> On 03/11/2014 09:37 PM, Tom Lane wrote:
>>> In particular, I'd like to see an exclusion that prevents local users
>>> from having the same name as any global user, so that we don't have
>>> ambiguity in GRANT and similar commands.  This doesn't seem simple to
>>> enforce (if we supported partial indexes on system catalogs, it would
>>> be ...) but surely this representation is more amenable to enforcing it
>>> than the existing one.
>> Should be workable if you're creating a local name - just check against
>> the list of global roles.
> Concurrent creations won't be safe without some sort of locking scheme.
> A unique index would be a lot better way of plugging that hole than a
> system-wide lock on user creation.  But not sure how to define a unique
> index that allows (joe, db1) to coexist with (joe, db2) but not with
> (joe, 0).
>
>             


Create (joe, db1), (joe, db2) ... for each global user? Might get a tad 
ugly if you have lots of global users or lots of databases.

Just trying to be a bit creative :-)

cheers

andrew



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: db_user_namespace a "temporary measure"
Следующее
От: Aidan Van Dyk
Дата:
Сообщение: Re: db_user_namespace a "temporary measure"