inheritance and FK - Mailing list pgsql-general

From Oleg Lebedev
Subject inheritance and FK
Date
Msg-id 993DBE5B4D02194382EC8DF8554A5273033593@postoffice.waterford.org
Whole thread Raw
Responses Re: inheritance and FK  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
I am trying to create two tables: parent and child. Child inherits from the parent and has a foregn key (FK) referencing parent's primary key (PK). Suppose parent table has one row with PK = 1 and I have one row in the child table with FK=1 and PK=2. Now, I want to insert another row in the child table with FK = 2, however it won't let me do this, since parent table does not have a record with PK = 2.
I was expecting that children tables will also be searched when verifying a foreign key constraint referencing the parent table.
Is there a way to force this kind of "hierarchical" foreign key constraint check?
 
Thanks.
 
Oleg

*************************************

This email may contain privileged or confidential material intended for the named recipient only.
If you are not the named recipient, delete this message and all attachments.
Any review, copying, printing, disclosure or other use is prohibited.
We reserve the right to monitor email sent through our network.

*************************************

pgsql-general by date:

Previous
From: Oleg Lebedev
Date:
Subject: table inheritance and db syncs
Next
From: Stephan Szabo
Date:
Subject: Re: inheritance and FK