comment on inheritance - Mailing list pgsql-bugs

From MikeSmialek@KnowledgeDynamics.com
Subject comment on inheritance
Date
Msg-id 00a201c15130$a3478d20$a1a7f9c7@kda20p02
Whole thread Raw
List 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

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Bug #481: java-building ant confused with xscreenhack-ant
Next
From: Orion
Date:
Subject: Index Scans Oddness