Re: Cannot create a type in pg_catalog

From: Dave Page <dpage(at)postgresql(dot)org>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: Cannot create a type in pg_catalog
Date: 2007-08-23 14:18:07
Message-ID: 46CD971F.6080604@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tom Lane wrote:
> Dave Page <dpage(at)postgresql(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Alvaro Herrera 2007-08-23 14:34:49 Re: Cannot create a type in pg_catalog
Previous Message Tom Lane 2007-08-23 14:06:36 Re: Cannot create a type in pg_catalog