Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id CA952475B8A for ; Wed, 30 Oct 2002 02:58:56 -0500 (EST) Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id 25234474E61 for ; Wed, 30 Oct 2002 02:58:56 -0500 (EST) Received: from klaster.net (pd88.krakow.cvx.ppp.tpnet.pl [213.76.39.88]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 023052B501; Wed, 30 Oct 2002 08:51:10 +0100 (CET) Message-ID: <3DBF92BF.4080506@klaster.net> Date: Wed, 30 Oct 2002 09:05:19 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: James Adams Cc: pgsql-sql@postgresql.org Subject: Re: Selecting * from the base table but getting the inheriteds References: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200210/398 X-Sequence-Number: 10115 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