Re: Question about inheritance
От | Bruce Momjian |
---|---|
Тема | Re: Question about inheritance |
Дата | |
Msg-id | 200106100348.f5A3mUZ25772@candle.pha.pa.us обсуждение исходный текст |
Ответ на | Re: Question about inheritance ("Dmitry G. Mastrukov" <dmitry@taurussoft.org>) |
Список | pgsql-hackers |
I have added this thread to TODO.detail/inheritance. > > "Christopher Kings-Lynne" <chriskl@familyhealth.com.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 > > > > > ---------------------------(end of broadcast)--------------------------- > TIP 6: Have you searched our list archives? > > http://www.postgresql.org/search.mpl > -- Bruce Momjian | http://candle.pha.pa.us pgman@candle.pha.pa.us | (610) 853-3000+ If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania19026
В списке pgsql-hackers по дате отправления: