Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd)

Поиск
Список
Период
Сортировка
От Stephan Szabo
Тема Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd)
Дата
Msg-id 013401bff1e4$7282de80$0c64010a@kick.com
обсуждение исходный текст
Ответ на Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
Список pgsql-hackers

> > How would one refer to an attribute whose name has changed in a
> > subclass if you're doing a select on the superclass (or do you even
> > need to do anything - does it figure it out automagically?)
> 
> If you had..
> create table a (aa text);
> create table b under a rename aa to bb ( );
> insert into a(aa) values('aaa');
> insert into b(bb) values('bbb');
> select * from a;
> 
> aa
> ---
> aaa
> bbb
> 
> The system knows that a.aa is the same as b.bb. The same attribute
> logically, just referred to by different names depending on the context.
> Eiffel handles it the same way if I remember right.

So, if you did, select * from a where aa>'a', it would properly mean 
the inherited attribute, even if an attribute aa was added to table b, 
possibly of a different type?  In that case I really wouldn't need to do 
anything special to handle the subtables since I'd always be doing the 
select for update on the table that was specified at creation time which
is the one I have the attributes for.




В списке pgsql-hackers по дате отправления:

Предыдущее
От: "Hiroshi Inoue"
Дата:
Сообщение: RE: btree split logic is fragile in the presence of lar ge index items
Следующее
От: "Mikheev, Vadim"
Дата:
Сообщение: RE: btree split logic is fragile in the presence of lar ge index items