Re: Inheritance - Mailing list pgsql-hackers

From Zeugswetter Andreas SB SD
Subject Re: Inheritance
Date
Msg-id 46C15C39FEB2C44BA555E356FBCD6FA4961E4A@m0114.s-mxs.net
Whole thread Raw
In response to Inheritance  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
Responses Re: Inheritance  (Curt Sampson <cjs@cynic.net>)
List pgsql-hackers
> > It's nonlocal constraints that are the problem, and here foreign keys
> > and UNIQUE constraints are certainly the canonical examples.  Both of
> > these would be largely solved with table-spanning indexes I think.
>
> Note that the other obvious way to solve this would be to store all of
> the information inherited from the parent in the parent table, so that
> you don't have to do anything special to make all of the constraints and
> whatnot apply.

Seems with above you are not able to constrain what qualifies for a supertable row,
you would only be able to specify constraints that apply to all it's subtables.
To me, the current implementation looks superior and more efficient.

The SQL inheritance is a class/subclass thing.
All tables have instances (==rows) that are not (by itself) related.
(Even if they happen to share all attribute values with another row of a supertable.)
If you want that, then you need to resort to 3NF (or ROWREF's which iirc is another
SQL99 feature).

Andreas


pgsql-hackers by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: tsearch bug in 7.2.1?
Next
From: "Iavor Raytchev"
Date:
Subject: Re: Companies involved in development