Re: Cannot create a type in pg_catalog - Mailing list pgsql-bugs

From Dave Page
Subject Re: Cannot create a type in pg_catalog
Date
Msg-id 46CD971F.6080604@postgresql.org
Whole thread Raw
In response to Re: Cannot create a type in pg_catalog  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Cannot create a type in pg_catalog
List pgsql-bugs
Tom Lane wrote:
> Dave Page <dpage@postgresql.org> writes:
>> Should this work, or at least give a more appropriate error message?
>> demo=# CREATE TYPE pg_catalog.mytype AS (data text);
>> ERROR:  permission denied to create "pg_catalog.mytype"
>> DETAIL:  System catalog modifications are currently disallowed.
>
> Seems like a perfectly appropriate error message to me: it's disallowed.

I see three issues:

- it's only partially disallowed - why can I create a function, but not
a type? Shouldn't both be either allowed or disallowed?


- The description in the docs of pg_authid.rolcatupdate reads:

Role may update system catalogs directly. (Even a superuser may not do
this unless this column is true)

However, even with it set to true, I cannot do so. Of course, this
depends on whether you define 'system catalogs' as the tables in
pg_catalog, or the pg_catalog schema itself. Either way, something's a
little wonky.


- "are currently disallowed" implies that sometimes it is allowed. How
does one control that, or is it implying something that is not the case,
or only the case in unusual circumstances such as a standalone backend?


Note that I'm making no comment on whether or not I should be able to do
 what I'm suggesting (thought preventing it will break adminpack) - just
that we have some inconsistencies at the very least.

Regards, Dave

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Cannot create a type in pg_catalog
Next
From: Alvaro Herrera
Date:
Subject: Re: Cannot create a type in pg_catalog