Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 5261563F09A for ; Sat, 6 Jun 2009 11:31:04 -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 58596-01-10 for ; Sat, 6 Jun 2009 11:31:00 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from qw-out-2122.google.com (qw-out-2122.google.com [74.125.92.26]) by mail.postgresql.org (Postfix) with ESMTP id 54C01637FEB for ; Sat, 6 Jun 2009 11:31:00 -0300 (ADT) Received: by qw-out-2122.google.com with SMTP id 8so1158991qwh.61 for ; Sat, 06 Jun 2009 07:30:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=WDalsruhT1b+DUngm9x7w4/9DRi4xDwrqBTwwCvMSkw=; b=oi+FaT3rINXZ0GcT097EHJv+HTb9ARcdIyClmCFR22J5mDWHgvT7f5m9Nqe3Tuzd89 VNn3y+kQ9BPR3fdy2ydGYbXsS5kzk9JdRuT4UtmVlSfEYEMqmfBYbN5Y6Su3YZ3Flf59 Sb3SCbco4V/ayGlvWczz0Lik+NgPz8C8aHKDo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=J2AZohW6qy5HWUgUeF+2066IriwXSkOWI8E1JTCrDyGPe49Nmr9ImRKp5FHP0/Xh1v QtlQLISoascY1TU4oVNNI2Bd9w2e1NKgQeqjD4kwX7rO3cOzNRJc97MQtjz4VRlwqIuB u+vah99THlgIN7zYqZyEg1n3/ysN+RJ2LKARk= MIME-Version: 1.0 Received: by 10.220.100.194 with SMTP id z2mr2972583vcn.38.1244298658058; Sat, 06 Jun 2009 07:30:58 -0700 (PDT) In-Reply-To: <5eca56860906060010y4177b88apcf587d62f7286b5d@mail.gmail.com> References: <5eca56860906050330w6171b327k95881b13c4dca466@mail.gmail.com> <4A294A00.5020802@gmail.com> <5eca56860906060010y4177b88apcf587d62f7286b5d@mail.gmail.com> Date: Sat, 6 Jun 2009 07:30:57 -0700 Message-ID: <396486430906060730t1afd39a9p49b056158b1d2194@mail.gmail.com> Subject: Re: Type inheritance From: Richard Broersma To: Gianvito Pio Cc: pgsql-sql@postgresql.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/29 X-Sequence-Number: 32634 On Sat, Jun 6, 2009 at 12:10 AM, Gianvito Pio wrote= : > That value doesn't have to be fixed, but I want to define it in=A0a > way that it changes its structure when the sensor type changes. For > example,=A0for Temperature sensor I would like to have=A0just a=A0float n= umber, > but for the humidity I could need of absolute and relative humidity > (2=A0floats). I'd just like to know if I can say that the VALUE is a comp= osite > type...that I have then to specialize in Temp Type=A0and Humidity type...= using > them in their particular case. I think that best solution for what you want to achieve is to design you own vertically partitioned table hierarchy. PostgreSQL's table inheritance isn't going to allow that relationships that you may want between the sub-types. Another PostgreSQL specific feature that allows for hierarchical data is the contrib module h-store. Its kind-of like EAV for a column instead of a table. --=20 Regards, Richard Broersma Jr. Visit the Los Angeles PostgreSQL Users Group (LAPUG) http://pugs.postgresql.org/lapug