Re: Re: [DOCS] Inheritance docs error. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Re: [DOCS] Inheritance docs error.
Date
Msg-id 12912.978457736@sss.pgh.pa.us
Whole thread Raw
In response to Re: Re: [DOCS] Inheritance docs error.  ("Robert B. Easter" <reaster@comptechnews.com>)
List pgsql-hackers
"Robert B. Easter" <reaster@comptechnews.com> writes:
> I thought about this UNDER/INHERITS stuff months ago and wrote this file:
> http://www.comptechnews.com/~reaster/pgoo.html

Good analysis, especially the fundamental point that UNDER is only
designed to support single inheritance, whereas INHERITS allows multiple
inheritance.

The current grammar treats UNDER as interchangeable with INHERITS,
including allowing multiple names to be listed as UNDER.  That would
certainly be a fatal mistake, since it would create a backwards
compatibility problem as soon as we wanted to support any of the
features of UNDER that require single inheritance.

> I'm not sure everything in the file is correct though.

One thing that bothered me is that my reading of the SQL99 draft
disallows the UNDER syntax you are using.  I read:

         <table definition> ::=
              CREATE [ <table scope> ] TABLE <table name>
                <table contents source>
                [ ON COMMIT <table commit action> ROWS ]

         <table contents source> ::=
                <table element list>
              | OF <user-defined type>
                  [ <subtable clause> ]
                  [ <table element list> ]

         <subtable clause> ::=
              UNDER <supertable clause>

         <supertable clause> ::= <supertable name>

It looks to me like "UNDER <table name>" cannot appear without a
preceding "OF <user-defined type>".  I am not clear on the semantic
implications of the OF clause.


Anyway, we seem to have a clear consensus to pull the UNDER clause from
the grammar and stick with INHERITS for 7.1.  I will take care of that
in the next day or so.

            regards, tom lane

pgsql-hackers by date:

Previous
From: Alfred Perlstein
Date:
Subject: Re: Using Threads?
Next
From: Peter Eisentraut
Date:
Subject: Re: [COMMITTERS] pgsql/src (Makefile.global.in)