Foreign keys don't work with inherited tables

From: Micah Yoder <yodermk(at)home(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Foreign keys don't work with inherited tables
Date: 2001-06-23 17:33:48
Message-ID: 01062313334801.01082@eclipse
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Attachment Content-Type Size
pg-bug text/x-c 4.1 KB

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Mark Patterson 2001-06-23 22:21:20 Error in README_for_BeOS for PostgreSQL 6.5.0
Previous Message dklee 2001-06-23 14:50:45 How to acces BLOB field in postgres with JAVA ?