Re: [HACKERS] Re-Name Attributes on Inheritance - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Re-Name Attributes on Inheritance
Date
Msg-id 17615.921080825@sss.pgh.pa.us
Whole thread Raw
In response to Re-Name Attributes on Inheritance  (Clark Evans <clark.evans@manhattanproject.com>)
List pgsql-hackers
Clark Evans <clark.evans@manhattanproject.com> writes:
> How difficult would it be to allow attribute
> names to be aliased when inheriting:
> ...
> Thoughts?  Is this _that_ bad of an idea.

It seems like a horrible idea to me ;-).  The point of inheritance
is that whatever else your derived class may be, it *IS A* parent-
class object as well, and anything that works on the parent class
will work on the subclass.  In your example,SELECT more_attrib FROM base where oldtag = something;
would work butSELECT more_attrib FROM derived where oldtag = something;
would fail.  That's not my idea of a derived class.

It's not clear exactly what you want to accomplish here, but I
wonder whether inheritance is the right model for the relationships
among the tables in your database at all.  It seems like you are
trying to force-fit some other kind of relationship into the
inheritance model.
        regards, tom lane


pgsql-hackers by date:

Previous
From: The Hermit Hacker
Date:
Subject: Re: [HACKERS] Developers globe
Next
From: Tom Lane
Date:
Subject: Re: [HACKERS] Re: map