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