Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id ECAF6475DFF for ; Wed, 30 Oct 2002 04:27:01 -0500 (EST) Received: from hotmail.com (oe26.pav2.hotmail.com [64.4.36.83]) by postgresql.org (Postfix) with ESMTP id 3E213475CE5 for ; Wed, 30 Oct 2002 04:27:01 -0500 (EST) Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Wed, 30 Oct 2002 01:27:02 -0800 X-Originating-IP: [217.168.173.114] From: "James Adams" To: "Tomasz Myrta" Cc: References: <3DBF92BF.4080506@klaster.net> Subject: Re: Selecting * from the base table but getting the inheriteds Date: Wed, 30 Oct 2002 10:25:17 +0100 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2720.3000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Message-ID: X-OriginalArrivalTime: 30 Oct 2002 09:27:02.0020 (UTC) FILETIME=[80D94440:01C27FF6] X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/402 X-Sequence-Number: 10119 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" To: "James Adams" Cc: 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 >