On Wed, Jun 6, 2012 at 4:39 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
> Robert Haas <robertmhaas@gmail.com> writes:
>> Right now, you can't directly create a relation (table, index,
>> composite type) in the pg_catalog schema, but you can create a
>> non-relation (function, domain, etc.) in the pg_catalog schema.
>
> Surely this is true only for superusers. Superusers can do whatever
> they want anyway, no?
No.
rhaas=# create table pg_catalog.tom (a int);
ERROR: permission denied to create "pg_catalog.tom"
DETAIL: System catalog modifications are currently disallowed.
rhaas=# create table tom (a int);
CREATE TABLE
rhaas=# alter table tom set schema pg_catalog;
ALTER TABLE
rhaas=# create domain pg_catalog.lane as int;
CREATE DOMAIN
The offending error check is in heap_create(), and based on what
you're saying here it seems like we should just rip it out.
--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company