Re: Inheritance and Foreign Keys

From: "Oliver Elphick" <olly(at)lfix(dot)co(dot)uk>
To: Nelio Alves Pereira Filho <nelio(at)ifx(dot)com(dot)br>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Inheritance and Foreign Keys
Date: 2001-01-04 22:25:27
Message-ID: 200101042225.f04MPRH11897@linda.lfix.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Nelio Alves Pereira Filho wrote:
>Here's my situation: I have the following relation
>
>table A -----<>------ table B
> 1:N
>
>I created the two tables, and a foreign key from A into B. Now I want to
>create other tables that inherit from B, but I want that the relation
>exists for all of them. For that, I created another table, C, that had
>just one field and inherited from B. No errors showed up, but it didn't
>complain when I inserted some data into C without the corresponding one
>in A!!
>
>Is it possible to do what I intended?

Unfortunately not. Inheritance is not properly thought out; at present
it allows fields to be duplicated and records selected from an inheritance
hierarchy, but this is relatively useless because constraints are not
inherited and indexes are not shared.

--
Oliver Elphick Oliver(dot)Elphick(at)lfix(dot)co(dot)uk
Isle of Wight http://www.lfix.co.uk/oliver
PGP: 1024R/32B8FAA1: 97 EA 1D 47 72 3F 28 47 6B 7E 39 CC 56 E4 C1 47
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839 932A 614D 4C34 3E1D 0C1C
========================================
"But because of his great love for us, God, who is rich
in mercy, made us alive with Christ even when we were
dead in transgressions-it is by grace you have been
saved." Ephesians 2:4,5

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Nelio Alves Pereira Filho 2001-01-04 22:36:29 Re: Inheritance and Foreign Keys
Previous Message Oliver Elphick 2001-01-04 22:22:00 Re: \connect