Foreign keys don't work with inherited tables - Mailing list pgsql-bugs

From Micah Yoder
Subject Foreign keys don't work with inherited tables
Date
Msg-id 01062313334801.01082@eclipse
Whole thread Raw
Responses Re: Foreign keys don't work with inherited tables
List pgsql-bugs
Using PostgreSQL 7.1.2 compiled with Red Hat 7.1's gcc 2.96.

I have a database that uses inherited tables.  The top level table of the
hierarchy has a serial column, which is the primary key.  Everything inserted
into any of its decendents and each shares the primary key and sequence of
the top table.  That works fine.

Another table (outside the hierarchy) uses a foreign key to the top level
primary key.  Inserting into this table works when the foreign key references
an item that is in the TOP level class of the hierarchy.  But when it
references a subclass, I get a "referential integrity violation".

Attached is a file with everything you should need to see what's up.

Please let me know if you need more info, and if there are any workarounds.
I guess I could not use a foreign key there but that would kind of suck ...

Thanks,
Micah

--
Like to travel?                        http://TravTalk.org
Micah Yoder Internet Development       http://yoderdev.com

pgsql-bugs by date:

Previous
From: "Lotus Luby-Loo"
Date:
Subject: ...
Next
From: "Mark Patterson"
Date:
Subject: Error in README_for_BeOS for PostgreSQL 6.5.0