Inherit trouble - Mailing list pgsql-general

From David Gianonatti
Subject Inherit trouble
Date
Msg-id CAPQWqp2B1=_6bNC6-jtKa_aodx4ThffMKVxUdwc1DKyjj0Z37A@mail.gmail.com
Whole thread Raw
Responses Re: Inherit trouble  ("David Johnston" <polobo@yahoo.com>)
List pgsql-general
Hello Everyone,

I got trouble with inherit and foreign key.

I give you example of what's it likes.

I got 4 tables :

- order
- order_details
- product
- hard_drive

Hard_drive inherit product
order_details got order on foreign key
order_details got product on foreign key

When I try to add an order_details line, with a hard drive product_id, I got message "SQL Error : an instruction insert or update on the table order_details fail on the integrity constraint of the foreign key pk_product detail : the key (id)=(9) does not exists on the table product"

The product 9 is a hard drive, so it's inserted in the hard drive table, but as it inherits product, I see it in product table too.

Why do i Have this message ? Can you help me ?

Thank you

David 

pgsql-general by date:

Previous
From: Tomas Vondra
Date:
Subject: Re: Performance Monitoring of PostGRE
Next
From: "David Johnston"
Date:
Subject: Re: Inherit trouble