Re: Inherit trouble

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'David Gianonatti'" <david(at)web-tribu(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: Inherit trouble
Date: 2011-07-06 22:13:22
Message-ID: 00d901cc3c29$ebdd5b20$c3981160$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


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

Working as designed; foreign keys and unique indexes are only valid for the
explicit table they point to.

You can try making "hard drive" have a one-to-one relationship with
"product" instead of inheriting from it. Either give "hard drive" its own
PK and add a "Product PK" to the table or have the "hard drive" and
"product" tables both use the same primary key (product PK) with a FK
between them.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Josh Kupershmidt 2011-07-06 22:31:05 Re: wiki error
Previous Message David Gianonatti 2011-07-06 19:52:47 Inherit trouble