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

From: "Stephan Szabo" <sszabo(at)kick(dot)com>
To: <chrisb(at)nimrod(dot)itg(dot)telstra(dot)com(dot)au>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd)
Date: 2000-07-20 00:50:06
Message-ID: 013401bff1e4$7282de80$0c64010a@kick.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2000-07-20 04:12:32 Re: unique constraint - bug?
Previous Message Chris Bitmead 2000-07-20 00:31:37 Re: Re: [GENERAL] PRIMARY KEY & INHERITANCE (fwd)

Browse pgsql-hackers by date

  From Date Subject
Next Message Mikheev, Vadim 2000-07-20 01:39:09 RE: btree split logic is fragile in the presence of lar ge index items
Previous Message Hiroshi Inoue 2000-07-20 00:41:55 RE: btree split logic is fragile in the presence of lar ge index items