Re: creating objects in pg_catalog

Robert Haas <robertmhaas@gmail.com>

From: Robert Haas <robertmhaas@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@postgresql.org
Date: 2012-06-06T21:09:31Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Checking to decide whether relations are system relations now depends

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