Re: Question about inheritance
От | Dmitry G. Mastrukov |
---|---|
Тема | Re: Question about inheritance |
Дата | |
Msg-id | 008901c0eda8$bc6fb520$016ba8c0@taurussoft.org обсуждение исходный текст |
Ответ на | Question about inheritance ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>) |
Ответы |
Re: Question about inheritance
|
Список | pgsql-hackers |
> "Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:> > Am I misunderstanding how the mechanism works, or isthis a big, noteasily> > solved, problem?>> The latter. Check the list archives for previous debates about this.> It'snot real clear whether an inherited primary key should be expected> to be unique across the whole inheritance tree, oronly unique per-table> (IIRC, plausible examples have been advanced for each case). If we want> uniqueness across multipletables, it'll take considerable work to> create an index mechanism that'd enforce it.>IMHO current behaviour of PostgreSQLwith inherited PK, FK, UNIQUE is simplybug not only from object-oriented but even object-related point of view. NowI can violate parent PK by inserting duplicate key in child! Inherited tables should honours all constraints from parent. If I changesome constraint (seems only FK, but not PK or UNIQUE)I should be able to doit in more restrictive manner. For example, two base table is connected viaFK. I can change such FK in childs from base1->base2to child1->child2 (orchild3) but not to child1->not_inherited_from_base2. CHECK, DEFAULT, NOTNULL are more freeto changes, isn't it? IMHO last message in doc/TODO.details/inheritance from Oliver Elphick is agood direction for implementing with exceptionon more rectrictive child FKconstraint (p.3 of message). As for me, I was pushed to rollback to scheme with no inheritance at all inmy project for now. So I'm very interesting inimplementing of rightinheritance and I wanted to ask similar question in one of the lists in nearfuture. Regards,Dmitry
В списке pgsql-hackers по дате отправления: