Yea it would be easier to have everything in one table filling unused with
nulls, but I was trying to avoid that because of the wasted space.

But I think I'll do it that way after all  :~]

Thanks for your help


----- Original Message -----
From: "Tomasz Myrta" <[EMAIL PROTECTED]>
To: "James Adams" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Wednesday, October 30, 2002 9:05 AM
Subject: Re: [SQL] Selecting * from the base table but getting the
inheriteds


> Uz.ytkownik James Adams napisa?:
> > Hello,
> >
> > I have a "baseTable".  I have a number of decendantTables that INHERIT
> > from the base table.
> >
> > I want to do somthing like
> >
> > =>select * from baseTable;
> >
> > But I want it to return the data in the all the descendant tables along
> > with the extra column that they contain.  How do I do this?
> >
>
> select
>   *,
>   cast(null as varchar) as another_field1,
>   cast(null as int4) as another_field2
> from only basetable
> union
> select
>   *
> from descent_table
>
> Isn't it easier to just create baseTable with the same columns as
> descent tables (and fill them with nulls)?
>
> Tomasz Myrta
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html
>

---------------------------(end of broadcast)---------------------------
TIP 4: Don't 'kill -9' the postmaster

Reply via email to