Re: foreign key constraints and inheritence

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Garrett Kalleberg <experimental(at)metadada(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: foreign key constraints and inheritence
Date: 2005-07-17 09:35:25
Message-ID: 20050717093525.GB88595@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Jul 16, 2005 at 05:39:59PM -0400, Garrett Kalleberg wrote:
>
> Now, the rec with id '1234' is in the table
> invoicelineiteminventorytypes, but I can't wrap my head around the
> fact that
>
> SELECT invoicelineitemtypeid FROM invoicelineitemtypes
>
> yields the rec with invoicelineitemtypeid '1234', yet I can't
> reference it in the invoicelines INSERT statement.

See the inheritance documentation:

http://www.postgresql.org/docs/8.0/static/ddl-inherit.html

"A serious limitation of the inheritance feature is that indexes
(including unique constraints) and foreign key constraints only
apply to single tables, not to their inheritance children. This
is true on both the referencing and referenced sides of a foreign
key constraint."

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Sander Steffann 2005-07-17 10:38:48 Re: foreign key constraints and inheritence
Previous Message Ron Mayer 2005-07-16 22:22:27 Re: How to create unique constraint on NULL columns