Re: Table inherit & foreign key problem

From: Richard Huxton <dev(at)archonet(dot)com>
To: Moritz Kobel <mailinglists(at)weisshorn(dot)kobelnet(dot)ch>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Table inherit & foreign key problem
Date: 2007-03-09 12:35:11
Message-ID: 45F1547F.4070105@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Moritz Kobel wrote:
> i would like to reference to the element table, because i have some
> tables which inherit from element and i would like to add comments to
> these elements.
>
> is this impossible or did i do a silly mistake? i did not find a
> solution unsing google.

Foreign-key limitations with inheritance I'm afraid. See the manuals for
details:

http://www.postgresql.org/docs/8.2/static/ddl-inherit.html
5.8.1 Caveats
...
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. Thus,
in the terms of the above example:
...

--
Richard Huxton
Archonet Ltd

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Chad Wagner 2007-03-09 13:14:16 Re: SHA-1 vs MD5
Previous Message Ezequias Rodrigues da Rocha 2007-03-09 12:34:59 Re: SHA-1 vs MD5