Re: fixing CREATEROLE - Mailing list pgsql-hackers

From Tom Lane
Subject Re: fixing CREATEROLE
Date
Msg-id 3441968.1669128615@sss.pgh.pa.us
Whole thread Raw
In response to Re: fixing CREATEROLE  (walther@technowledgy.de)
Responses Re: fixing CREATEROLE
List pgsql-hackers
walther@technowledgy.de writes:
> 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.

> 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?

No, we don't support partial indexes on catalogs, and I don't think
we want to change that.  Partial indexes would require expression
evaluations occurring at very inopportune times.

Also, we don't support creating shared indexes post-initdb.
The code has hard-wired lists of which relations are shared,
besides which there's no way to update other databases' pg_class.

Even without that, the idea of a shared catalog ending up with 10000
indexes after you create 10000 databases (requiring 10^8 pg_class
entries across the whole cluster) seems ... unattractive.

            regards, tom lane



pgsql-hackers by date:

Previous
From: walther@technowledgy.de
Date:
Subject: Re: fixing CREATEROLE
Next
From: Peter Eisentraut
Date:
Subject: Re: psql: Add command to use extended query protocol