Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f3A2Sj874042 for ; Mon, 9 Apr 2001 22:28:45 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3A2P4870694 for ; Mon, 9 Apr 2001 22:25:04 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f3A1xr918258 for pgsql-sql@postgresql.org; Mon, 9 Apr 2001 21:59:53 -0400 (EDT) (envelope-from news) From: Mark Butler X-Newsgroups: comp.databases.postgresql.sql Subject: Inheritance Semantics Date: Mon, 09 Apr 2001 19:59:56 -0600 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 36 Message-ID: <3AD2691C.35AD23F3@middle.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.75 [en] (WinNT; U) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200104/129 X-Sequence-Number: 2476 Could someone (Chris Mead?) post an update on the status of fixing PostgreSQL's inheritance semantics in the following ways: Has a decision been made to implementing true inheritance via INHERITS or an alternative keyword? By true inheritance, I mean first and foremost that any query on a super-class should query *all members* of that class by default regardless of which table they are stored in. Any other behavior violates the very natural expectation that a table called "PERSON" actually implements the class of all persons. Second, for performance reasons, there needs to be a way for an index on a parent class attribute to be shared by all the tables that implement or inherit from that parent class. This is also necessary to enforce unique constraints on all members of a class. I imagine that the current implementation of "SELECT column FROM table*" is a logical UNION ALL of the select statement applied to each sub table, using different indexes for each one - Is this correct? Third, all declarative constraints on a parent class should be enforced against all members of all sub-classes without exception. Fourth, someday it would be nice to be able to create object methods & member functions that operate in the context of a single object. Does anyone know if the OQL supports this capability? I understand the backwards compatibility issue with the current semantics. Rather than adding some sort of run-time setting, I think it would be much better to add a new keyword / extension to the DDL syntax so that true ODMG style inheritance can be implemented correctly without breaking old applications. Any comments would be appreciated. - Mark Butler