comment on inheritance

From: MikeSmialek(at)KnowledgeDynamics(dot)com
To: <pgsql-bugs(at)postgresql(dot)org>
Subject: comment on inheritance
Date: 2001-10-10 02:09:29
Message-ID: 00a201c15130$a3478d20$a1a7f9c7@kda20p02
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

I am a new user to PG (graduating from Access) and had some problems with
inheritance. I stumbled into the inheritance to-do discussion and would like
to put in my two cents. I apologize if this is not the right place to be
sending this.

It seems PG needs two separate types of inheritance: structural inheritance
and 'is-a' inheritance.

Structural inheritance would help the 'inheritance is a convenience' people.
Structural children would inherit foreign keys and per-field validation.
Structural children would not inherit primary keys, or would allow a primary
key declared on the child to override the parent's primary key, not augment
it. I think structural children should have separate indices (by the same
name if possible) from the parent.

'is-a' children would inherit all constraints and share indices and primary
keys with the parent and any siblings, descendants, etc.

Of course this can all be achieved currently by specifying the parent with
no primary key and adding a primary key to the descendants. But it seems
that making this sort of thing more explicit with 'inherit-struct' and
'inherit-is-a' would clear up a lot of confusion.

Thanks

Browse pgsql-bugs by date

  From Date Subject
Next Message Ralf Miller 2001-10-10 08:11:31 probably a bug of data-type serial
Previous Message pgsql-bugs 2001-10-09 19:17:09 Bug #477: path ?# path