On Mon, 2002-07-29 at 19:01, Curt Sampson wrote:
> On Mon, 29 Jul 2002, Bruce Momjian wrote:
>
> > Curt Sampson wrote:
> > > I'm still waiting to find out just what advantage table inheritance
> > > offers. I've asked a couple of times here, and nobody has even started
> > > to come up with anything.
It is mostly a syntactic thing that makes it easier to humans to write
cleaner code.
Otherwise, it is proved that anything can be written for a Turing
Machine ;)
> > We inherited inheritance from Berkeley. I doubt we would have added it
> > ourselves. It causes too much complexity in other parts of the system.
>
> Ah, all the more reason to remove it, then! :-)
>
It would make more sense to make it compatible with SQL99 and drop the
current behaviour only after that if possible.
As it stands now it is a strange mix of SQL99's
CREATE TABLE thistable(...,LIKE anothertable,...);
and CREATE table mytable(...) UNDER anothertable;
with only a few additional goodies, like SELECT* (i.e not ONLY) which
selects from all tables that inherit from this.
other things that should be done are not (like inheriting constraints,
foreign and primary keys, triggers, ...)
Also we currently can't return more than one recordset from a query,
which also makes selecting from an inheritance hierarchy less versatile.
-----------
Hannu