Re: RI problem with inherited table - Mailing list pgsql-hackers

From Tom Lane
Subject Re: RI problem with inherited table
Date
Msg-id 14223.977507535@sss.pgh.pa.us
Whole thread Raw
In response to RI problem with inherited table  ("Oliver Elphick" <olly@lfix.co.uk>)
List pgsql-hackers
"Oliver Elphick" <olly@lfix.co.uk> writes:
> It no longer seems to be possible to refer to a table, which is an
> ancestor of any other, in a referential integrity constraint.

> bray=# create table junk (id char(10) constraint junk_id_person references 
> person(id));
> NOTICE:  CREATE TABLE will create implicit trigger(s) for FOREIGN KEY check(s)
> CREATE
> bray=# insert into junk values ('aa');
> ERROR:  SELECT FOR UPDATE is not supported for inherit queries

Hm.  The short-term answer seems to be to modify the queries generated
by the RI triggers to say "ONLY foo".  I am not sure whether we
understand the semantics involved in allowing a REFERENCES target to be
taken as an inheritance tree rather than just one table, but certainly
the current implementation won't handle that correctly.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Oliver Elphick"
Date:
Subject: RI problem with inherited table
Next
From: Tom Lane
Date:
Subject: Inheritance is a security loophole!