I am currently reading up on the history behind inheritance in
postgres and found this interesting post back in May
2000. http://archives.postgresql.org/pgsql-hackers/2000-05/msg01349.php From reading other posts, it seems that there is the idea
that since under is single inheritance then tables “under” another
are all really in that same relation only they act the as expected to the
user. It seems that this would
allow backwards compatibility with current postgres
databases that use inheritance and offers a simplified single relation inheritance
that would fix problems with primary keys (references don’t see id’s
created via a child table,etc),
constraints, triggers, etc. http://archives.postgresql.org/pgsql-hackers/2002-08/msg01103.php http://archives.postgresql.org/pgsql-hackers/2002-09/msg01207.php Since the old inheritance stuff would be the same as now
(does not inherit primary key, etc.) it would address other concerns as well: http://archives.postgresql.org/pgsql-hackers/2002-08/msg01099.php From a point of view, inheritance is not broken it just
works a different way; it does not violate constraints because the “only”
clause shows that the value is not really in that table. With “under”, the only
clause, if it exists at all, could just basically filter for entries not added
to columns from any “tables” added via under and show only the
value directly inserted into the parent columns. Tables under another are physically one relation, tables inheriting from one another are physically
different relations. Besides, “under” would be a new feature! Babak. |