Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd) - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd)
Date
Msg-id 013401bff1e4$7282de80$0c64010a@kick.com
Whole thread Raw
In response to Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd)  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List 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 by date:

Previous
From: "Hiroshi Inoue"
Date:
Subject: RE: btree split logic is fragile in the presence of lar ge index items
Next
From: "Mikheev, Vadim"
Date:
Subject: RE: btree split logic is fragile in the presence of lar ge index items