Re: fixing CREATEROLE

Поиск
Список
Период
Сортировка
От walther@technowledgy.de
Тема Re: fixing CREATEROLE
Дата
Msg-id fda52bc3-c2e8-39c2-f4d9-efcececc596c@technowledgy.de
обсуждение исходный текст
Ответ на Re: fixing CREATEROLE  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: fixing CREATEROLE
Список pgsql-hackers
Robert Haas:
> 2. There are some serious implementation challenges because the
> constraints on duplicate object names must be something which can be
> enforced by unique constraints on the relevant catalogs. Off-hand, I
> don't see how to do that. It would be easy to make the cluster roles
> all have unique names, and it would be easy to make the database roles
> have unique names within each database, but I have no idea how you
> would keep a database role from having the same name as a cluster
> role. For anyone to try to implement this, we'd need to have a
> solution to that problem.

For each database created, create a partial unique index:

CREATE UNIQUE INDEX ... ON pg_authid (rolname) WHERE roldatabase IN (0, 
<database_oid>);

Is that possible on catalogs?

Best,

Wolfgang



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

Предыдущее
От: Dilip Kumar
Дата:
Сообщение: Re: Add 64-bit XIDs into PostgreSQL 15
Следующее
От: Tom Lane
Дата:
Сообщение: Re: fixing CREATEROLE