UNDER and INHERITS

From: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
To: pgsql-hackers-oo(at)postgresql(dot)org
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: UNDER and INHERITS
Date: 2000-05-26 12:20:03
Message-ID: 00052609014300.30714@comptechnews
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Rather than going on and on about the subject in little emails, I've put
together some information about UNDER and INHERITS, as I see them, on a
webpage at:

http://www.comptechnews.com/~reaster/pgoo.html

People might consider what it says in deciding the fate of INHERITS and of how
to implement SQL's UNDER. I'm of the feeling that UNDER should be implemented
according to official standard SQL-1999. INHERITS should be left as the
PostgreSQL multiple inheritance language extension, rather than implementing
nonstandard draft proposals of UNDER, which would amount to replacing one
PostgreSQL language extension for multiple inheritance for just another
PostgreSQL language extension for the same thing, just under a different name.
It would only disrupt any userbase of INHERITS and introduce all the
problems the designers of SQL sought to avoid. INHERITS, the way it stands,
is a good, simple inheritance mechanism. It does not transfer attribute (as
far as I know) constraints like UNIQUE and PRIMARY KEY, nor does it allow an
index to be shared on those because such things create issues in multiple
inheritance. ALTER TABLE ADD can be used to reestablish constraints on
inherited attributes though, but without an ability share an index like
supertable and subtable is intended (I think) to do. The official single
inheritance UNDER, is designed to support inheritance of constraints and the
sharing of indices from the maximal supertable down into its subtables. The
maximal supertable is required to have some UNIQUE NOT NULL attribute for this
purpose (SQL-1999 Foundation, Section 11.3, Syntax Rule 7.g). I feel that maybe
standard single-inheritance UNDER and the current PostgreSQL extension,
INHERITS, can be used together to complement each other. INHERITS provides a
simple multiple inherit ability. UNDER provides a feature-rich single
inheritance container where subtables are extensions the maximal supertable.
One change I think is not unreasonable, is that INHERITS allow parent tables to
be dropped. I'd like to know the reason why its not allowed now.

--
Robert B. Easter
reaster(at)comptechnews(dot)com

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2000-05-26 12:20:12 Re: syslog fix
Previous Message Hannu Krosing 2000-05-26 11:09:00 Re: Berkeley DB...