Re: creating objects in pg_catalog - Mailing list pgsql-hackers

From Robert Haas
Subject Re: creating objects in pg_catalog
Date
Msg-id CA+TgmoYCVMZGXB3Xcm0p=8szvGLtYUeEkS=0UariqFLtdLFn6g@mail.gmail.com
Whole thread Raw
In response to Re: creating objects in pg_catalog  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: creating objects in pg_catalog
List pgsql-hackers
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


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Avoiding adjacent checkpoint records
Next
From: Tom Lane
Date:
Subject: Re: creating objects in pg_catalog