inheritance and FK

From: Oleg Lebedev <oleg(dot)lebedev(at)waterford(dot)org>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: inheritance and FK
Date: 2003-03-03 20:19:14
Message-ID: 993DBE5B4D02194382EC8DF8554A5273033593@postoffice.waterford.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Stephan Szabo 2003-03-03 20:21:38 Re: inheritance and FK
Previous Message Oleg Lebedev 2003-03-03 19:46:30 table inheritance and db syncs