On Mon, 3 Mar 2003, Oleg Lebedev wrote:
> 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?
Not currently. Currently the check is applied only to the named table.
In general, inheritance needs alot of work, and we need a comprehensive
plan for all the problems (for example, primary keys also don't inherit).