Re: blocking referencing system catalogs in 8.4 breaks my code

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "J(dot) Greg Davidson" <jgd(at)well(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: blocking referencing system catalogs in 8.4 breaks my code
Date: 2009-06-05 22:34:14
Message-ID: 4A299D66.5070107@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg,

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

We should probably error out on this.

> 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?

System tables have special properties which can make modifications to
them behave non-transactionally. So it's never safe to have a trigger
on a system table. I'm frankly surprised that this worked for you before.

> 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?

I can't off the top of my head think of a "preferred way".

> 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.

I agree that GRANT REFERENCES should error. Do you have a suggestion
where in the manual would be a good place to warn people that FKs
against the system tables are a bad idea?

--
Josh Berkus
PostgreSQL Experts Inc.
www.pgexperts.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2009-06-05 22:49:08 Re: 8.4b2 tsearch2 strange error
Previous Message Josh Berkus 2009-06-05 22:24:24 Re: pg_migrator issue with contrib