Re: AW: Postgresql OO Patch

From: "Robert B(dot) Easter" <reaster(at)comptechnews(dot)com>
To: Zeugswetter Andreas SB <ZeugswetterA(at)wien(dot)spardat(dot)at>, "'Postgres Hackers List'" <hackers(at)postgresql(dot)org>
Subject: Re: AW: Postgresql OO Patch
Date: 2000-05-24 17:37:18
Message-ID: 00052413555701.22787@comptechnews
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 24 May 2000, Zeugswetter Andreas SB wrote:
> > One more time for the <general> mailing list...
> >
> > Hands up if you have objections to the patch I recently submitted for
> > postgresql. It fixes the long standing bit-rot / bug that DELETE and
> > UPDATE don't work on inheritance hierarchies, and it adds the ONLY
> > syntax as mentioned in SQL3 and as implemented by Informix.
> > The downside
> > is it breaks compatibility with the old inheritance syntax.
> > But there is
> > a backward compatibility mode. I.e. "SELECT * FROM foobar*" becomes
> > "SELECT * FROM foobar", and "SELECT * from foobar" becomes "SELECT *
> > FROM ONLY foobar".
> >
> > Benefits:
> > *) SQL3 says it.
>
> Imho this alone more than justifies the patch.
> We should also change our keyword "inherits" to "under".
>

I don't agree. UNDER only provides for single inheritance according to spec.
Making it multiple inherit would break UNDER's basic idea of enabling hierarchy
trees that contain subtables under a single maximal supertable. Its like a
body that grows by having organs and cells inside it. INHERIT is like two or
more separate bodies that together, yield an independent offspring. UNDER and
INHERIT can coexist and be used together.

CREATE TABLE bike (
);
CREATE TABLE motorbike UNDER bike (
) INHERITS (pistonengine);
CREATE table harley (
) UNDER motorbike;

CREATE engine (
);
CREATE TABLE pistonengine UNDER engine (
)
CREATE TABLE jetengine UNDER engine (
);

Stuff like that.

CREATE motorbike (
) INHERITS (bike, motor);
is ok too. But the meaning is different than above. It creates an independent
child table that is not contained under either parent so that the parents can
be dropped. You use UNDER when the child/subtabe to share the exact same
physical PRIMARY KEY of the SUPERTABLE. In inherit, the child inherits a
composite key from the parents, but that key is new physically, not the same
physically as any parents.

I just think that since UNDER is limited by the spec, (and there is a
difference anyway), that INHERITS stands on its own and can be used with UNDER
to pull attributes into the tree from another tree/table, linking separate
trees together in an nondependent way.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2000-05-24 21:50:39 Re: Serious problem within authentication subsystem in 7.0
Previous Message Robert B. Easter 2000-05-24 17:19:18 Re: Fwd: Re: SQL3 UNDER