Re: [pgsql] inherits and foreign key problem - Mailing list pgsql-general

From A. Kretschmer
Subject Re: [pgsql] inherits and foreign key problem
Date
Msg-id 20070424050346.GA11053@a-kretschmer.de
Whole thread Raw
In response to [pgsql] inherits and foreign key problem  ("Magicloud Magiclouds" <magicloud.magiclouds@gmail.com>)
List pgsql-general
am  Tue, dem 24.04.2007, um 10:30:15 +0800 mailte Magicloud Magiclouds folgendes:
> Dear all,
>    I have some tables like below, and now i have one record for each
> in simple_texts, simple_directories and side_types. Now I want to
> insert one record into sides (from simple_directory to simple_text
> with side_type), but it report error: can not insert or update
> "sides", against foreign key "sides_from_fkey". detail: key (from)=(2)
> is not present in table "base_nodes".
>    How does this happen? How to resolve?

Quotation from
http://www.postgresql.org/docs/current/interactive/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.


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID:   0x3FFF606C, privat 0x7F4584DA   http://wwwkeys.de.pgp.net

pgsql-general by date:

Previous
From: "Andrej Ricnik-Bay"
Date:
Subject: Re: Major differences between 7.1.1 and 7.4.x
Next
From: "Magnus Hagander"
Date:
Subject: Re: ERROR: Failed to build any 5-way joins