Skip site navigation (1) Skip section navigation (2)

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$ (view raw, whole thread or download thread mbox)
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
 > > 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
 bug not only from object-oriented but even object-related point of view.
 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
 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



pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group