On Wed, Dec 21, 2005 at 01:52:34PM +0100, Martijn van Oosterhout wrote: > On Sun, Dec 04, 2005 at 10:59:10PM -0700, Trent Shipley wrote: > > Relational Constraint Inheritance Algebra > > With regard to class and attribute uniqueness > > It's taken a while to digest this and sorry for the delay. While I find > the ideas intreguing there is a little voice in the back of my head > asking: practical applications? I would assume quite a few people would use table inheritance in a simple way were it available in a more convenient fashion: to transport fields, primary and foreign keys to child tables. In GNUmed (a medical practice application) http://salaam.homeunix.com/twiki/bin/view/Gnumed/WebHome we use inheritance to make tables inherit a) audit fields b) common clinical fields such as a pointer to the patient We overcome the primary/foreign key problem by a) letting child tables have their own primary key which is quite useful anyways and b) re-declaring foreign keys on child tables. While using inheritance isn't strictly necessary it is quite convenient and makes the schema more intuitive. There's also one major gain: since all clinical child tables store their unstructured narrative in a field provided by the clin_root_item parent table doing a search across the entire narrative of the medical record is a simple query against one table. http://cvs.savannah.gnu.org/viewcvs/gnumed/gnumed/server/sql/?root=gnumed (see gmAudit.sql and gmclinical.sql) > The only situation I've come across inheitence being truly useful would > be where you have several different "services" which are associated > with a customer but each require different services. Yes, this is similar to what we do. Karsten -- GPG key ID E4071346 @ wwwkeys.pgp.net E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346