blocking referencing system catalogs in 8.4 breaks my code

From: "J(dot) Greg Davidson" <jgd(at)well(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: blocking referencing system catalogs in 8.4 breaks my code
Date: 2009-06-05 20:59:24
Message-ID: 40677.74.7.85.158.1244235564.squirrel@webmail.well.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

In testing my software on postgresql-8.4beta[12] I got

ERROR: 42501: permission denied: "pg_namespace" is a system catalog
LOCATION: ATAddForeignKeyConstraint, tablecmds.c:4599

from my code which has a column
schema_name name NOT NULL REFERENCES pg_namespace ON DELETE CASCADE

this despite PostgreSQL happily accepting:
GRANT REFERENCES ON pg_namespace TO greg;

I found the change in tablecmds.c and a mention of it in PostgreSQL
Weekly News - May 17 2009, yet I don't understand why referencing
a system table in this manner should be a problem - is it?

I'm trying to have certain rows of my tables go away if certain
schemas are dropped. Is there a preferred way to do this?

If this regression is retained, it needs to be documented in the
reference manual AND I think that an attempt to GRANT REFERENCES
privileges to a system table should not be allowed.

BTW, I'm loving most of what I see in 8.4,

_Greg

J. Greg Davidson

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dimitri Fontaine 2009-06-05 21:40:52 Re: Documentation: GiST extension implementation
Previous Message Bruce Momjian 2009-06-05 20:26:48 Re: pg_migrator issue with contrib