Re: [HACKERS] Re-Name Attributes on Inheritance

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Re-Name Attributes on Inheritance
Дата
Msg-id 17615.921080825@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re-Name Attributes on Inheritance  (Clark Evans <clark.evans@manhattanproject.com>)
Список 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 по дате отправления:

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: [HACKERS] Developers globe
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [HACKERS] Re: map