Re: Question about inheritance

From: "Dmitry G(dot) Mastrukov" <dmitry(at)taurussoft(dot)org>
To: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Question about inheritance
Date: 2001-06-05 10:17:33
Message-ID: 008901c0eda8$bc6fb520$016ba8c0@taurussoft.org
Views: Raw Message | Whole Thread | Download mbox
Thread:
Lists: pgsql-hackers

> "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au> writes:
> > Am I misunderstanding how the mechanism works, or is this a big, not
easily
> > solved, problem?
>
> The latter. Check the list archives for previous debates about this.
> It's not real clear whether an inherited primary key should be expected
> to be unique across the whole inheritance tree, or only unique per-table
> (IIRC, plausible examples have been advanced for each case). If we want
> uniqueness across multiple tables, it'll take considerable work to
> create an index mechanism that'd enforce it.
>
IMHO current behaviour of PostgreSQL with inherited PK, FK, UNIQUE is
simply
bug not only from object-oriented but even object-related point of view.
Now
I can violate parent PK by inserting duplicate key in child!

Inherited tables should honours all constraints from parent. If I change
some constraint (seems only FK, but not PK or UNIQUE) I should be able to
do
it in more restrictive manner. For example, two base table is connected via
FK. I can change such FK in childs from base1->base2 to child1->child2 (or
child3) but not to child1->not_inherited_from_base2. CHECK, DEFAULT, NOT
NULL are more free to changes, isn't it?

IMHO last message in doc/TODO.details/inheritance from Oliver Elphick is a
good direction for implementing with exception on more rectrictive child FK
constraint (p.3 of message).

As for me, I was pushed to rollback to scheme with no inheritance at all in
my project for now. So I'm very interesting in implementing of right
inheritance and I wanted to ask similar question in one of the lists in
near
future.

Regards,
Dmitry

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Horst Herb 2001-06-05 11:05:59 full write log
Previous Message Vince Vielhaber 2001-06-05 10:16:35 Re: Mirrors not tracking main ftp site?