Search Postgresql Archives

Inherit trouble

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux