Re: Inheritance

From: Curt Sampson <cjs(at)cynic(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Greg Copeland <greg(at)CopelandConsulting(dot)Net>, Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, PostgresSQL Hackers Mailing List <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Inheritance
Date: 2002-08-15 00:05:51
Message-ID: Pine.NEB.4.44.0208150900010.463-100000@angelic.cynic.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 14 Aug 2002, Tom Lane wrote:

> I agree. Table-spanning indexes would be a large, complex,
> difficult-to-get-right feature. Before diving into that we should get
> some idea of just how we'd actually use them, and whether that's the
> only big chunk of work standing between us and a more useful inheritance
> feature. I'm afraid we might do all that effort and then discover there
> are other showstoppers.

That's my biggest fear as well. Here are a couple of possible
assertions we could make about supertables and subtables that have,
I think, some fairly far-reaching implications.

1. All constraints one places on a supertable must "work." That is,
they must apply on all subtables as well, and must always be true
on the supertable. For example, if I apply the constraint, "this
int field must be no smaller than 1 and no larger than 100," to the
supertable, this must apply to all subtables, and you must not be
able to remove the constraint from just a subtable."

2. It must not be possible apply a constraint to a supertable that
could be violated.

3. All constraints that one can apply to a non-inherited table in
postgresql must also be able to be applied to a supertable.

Depending on which of these you want to implement, and how you do
it, you may get yourself into a position where you can create a
table that that cannot have subtables, or cannot put certain constraints
on supertables....

cjs
--
Curt Sampson <cjs(at)cynic(dot)net> +81 90 7737 2974 http://www.netbsd.org
Don't you know, in this new Dark Age, we're all light. --XTC

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-08-15 00:20:11 Re: Inheritance
Previous Message Vince Vielhaber 2002-08-14 23:59:33 Re: Open 7.3 items