Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 15CB36349C8 for ; Fri, 5 Jun 2009 16:36:44 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 41186-10 for ; Fri, 5 Jun 2009 16:36:40 -0300 (ADT) X-Greylist: delayed 02:58:08.435176 by SQLgrey-1.7.6 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) by mail.postgresql.org (Postfix) with ESMTP id E8CCE6349B6 for ; Fri, 5 Jun 2009 16:36:40 -0300 (ADT) Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtp (Exim 4.62) (envelope-from ) id 1MCcR5-00043y-AP; Fri, 05 Jun 2009 10:38:31 -0600 Received: from [208.187.158.94] (helo=[172.16.1.231]) by in01.mta.xmission.com with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MCcR5-0002Fs-5u; Fri, 05 Jun 2009 10:38:31 -0600 Message-ID: <4A294A00.5020802@gmail.com> Date: Fri, 05 Jun 2009 10:38:24 -0600 From: Rob Sargent User-Agent: Thunderbird 2.0.0.21 (X11/20090318) MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Re: Type inheritance References: <5eca56860906050330w6171b327k95881b13c4dca466@mail.gmail.com> In-Reply-To: <5eca56860906050330w6171b327k95881b13c4dca466@mail.gmail.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-XM-SPF: eid=; ; ; mid=; ; ; hst=in01.mta.xmission.com; ; ; ip=208.187.158.94; ; ; frm=robjsargent@gmail.com; ; ; spf=neutral X-SA-Exim-Connect-IP: 208.187.158.94 X-SA-Exim-Rcpt-To: pgsql-sql@postgresql.org, robjsargent@gmail.com X-SA-Exim-Mail-From: robjsargent@gmail.com X-SA-Exim-Scanned: No (on in01.mta.xmission.com); Exit with error (see exim mainlog) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200906/25 X-Sequence-Number: 32630 I'm not sure how Temperature and Humidity are related as types beyond "extends float". i.e. What tuple definition could alternatively have a Temp or a Humidity value? (I do understand their physical relationship :) ) Gianvito Pio wrote: > Hi all, > I just want to ask you if it's possible to define sub types in > PostgreSQL (Type inheritance). I found that table inheritance is > possible...but I'd like to do it on types. > > Example: > define a type Value and two subtypes Temperature and Humidity and then > define a table that has an attribute of Value type (that can accept > both specialized types). > > Thanks