pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Mark Butler <butlerm@middle.net>
To: pgsql-sql@postgresql.org
Subject: Inheritance Semantics
Date: Mon, 09 Apr 2001 19:59:56 -0600
Message-ID: <3AD2691C.35AD23F3@middle.net> (raw)

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



view thread (2+ messages)  latest in thread

Message-ID: <3AD2691C.35AD23F3@middle.net>
Permalink:  ../3AD2691C.35AD23F3@middle.net/
Also on:    postgresql.org/message-id/3AD2691C.35AD23F3@middle.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: butlerm@middle.net
  Subject: Re: Inheritance Semantics
  In-Reply-To: <3AD2691C.35AD23F3@middle.net>
  References: <3AD2691C.35AD23F3@middle.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox