BUG #1146: REFERENCES doesn't work on Inherited Tables - Mailing list pgsql-bugs

From PostgreSQL Bugs List
Subject BUG #1146: REFERENCES doesn't work on Inherited Tables
Date
Msg-id 20040506113642.D7DB3CF54B9@www.postgresql.com
Whole thread Raw
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1146
Logged by:          Gábor Katona

Email address:      katonag@dragon.klte.hu

PostgreSQL version: 7.3.4

Operating system:   Cygwin

Description:        REFERENCES doesn't work on Inherited Tables

Details:

  The inserting of a row into a table doesn't reflect in the mother table
when the mother table is referenced from a third one.

Example
'a' is the mother table, 'b' is the child, and there is a reference to 'a'
in table 'c'

create table a( id INT UNIQUE, name VARCHAR);
create table b( foofoo INT) INHERITS(a);
create table c (id INT UNIQUE, bar INT, foo  INT REFERENCES "a"("id"));

insert into b VALUES (1,'first',0);
insert into b VALUES (2,'second',3);

Then inserting into 'c'

insert into c values (1,3,2);

and the result is unfortunately:
$1 referential integrity violation - key referenced from c not found in a

which means, that id=2 is not in table 'a'.

pgsql-bugs by date:

Previous
From: Sean Chittenden
Date:
Subject: Re: [GENERAL] cache lookup of relation 165058647 failed
Next
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1147: Getting rid of LD_LIBRARY_PATH