Re: blocking referencing system catalogs in 8.4 breaks my code - Mailing list pgsql-hackers

From Josh Berkus
Subject Re: blocking referencing system catalogs in 8.4 breaks my code
Date
Msg-id 4A299D66.5070107@agliodbs.com
Whole thread Raw
In response to blocking referencing system catalogs in 8.4 breaks my code  ("J. Greg Davidson" <jgd@well.com>)
Responses Re: blocking referencing system catalogs in 8.4 breaks my code  ("J. Greg Davidson" <jgd@well.com>)
List 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


pgsql-hackers by date:

Previous
From: Josh Berkus
Date:
Subject: Re: pg_migrator issue with contrib
Next
From: Tom Lane
Date:
Subject: Re: 8.4b2 tsearch2 strange error