Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id D04DD63255B for ; Sat, 6 Jun 2009 11:19:06 -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 56107-09 for ; Sat, 6 Jun 2009 11:19:05 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f213.google.com (mail-fx0-f213.google.com [209.85.220.213]) by mail.postgresql.org (Postfix) with ESMTP id 747416321BD for ; Sat, 6 Jun 2009 11:19:05 -0300 (ADT) Received: by fxm9 with SMTP id 9so1138170fxm.19 for ; Sat, 06 Jun 2009 07:19:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:from:to:references :in-reply-to:subject:date:mime-version:content-type :content-transfer-encoding:x-priority:x-msmail-priority:x-mailer :x-mimeole; bh=t9mXdCvH/P4tqVgvovzlTiab0Q5twOqyaNuaA2cIY+g=; b=HvPNaTk0f5g4uu9HIhY3BO2vcoc4uYniZAz5mwnC8t/o0HYprnL/9BOKTcU3RuTg1b 7qvMJNv/iuPBdU/xt6czJsioakFsimfX5HEDn4S6pVRgc26YXWMEpu0EDGxG0h1dGuMx 0LgYcD4Myky9s5IqhjdNOM6fBXbJx+hio3a0w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:from:to:references:in-reply-to:subject:date:mime-version :content-type:content-transfer-encoding:x-priority:x-msmail-priority :x-mailer:x-mimeole; b=oe9oxpqQePptyDJPLy/9bfsYJxSEb37kVO1ETlj6BxANq1xZDiTku1l+olcOacF/YB zaHWj08t8MP31K9Q7qGbuUZjCOYXviJuzCyAhCD6DvybQZuPMHGCGfJwltvhEIDIjm5l jrFo3jEApAaha8mlJTNKbcfWSmT4eUE0CxbbA= Received: by 10.86.91.13 with SMTP id o13mr5073466fgb.23.1244297943140; Sat, 06 Jun 2009 07:19:03 -0700 (PDT) Received: from PCGianvito (net-93-144-67-169.t2.dsl.vodafone.it [93.144.67.169]) by mx.google.com with ESMTPS id e11sm2351801fga.21.2009.06.06.07.19.01 (version=SSLv3 cipher=RC4-MD5); Sat, 06 Jun 2009 07:19:02 -0700 (PDT) Message-ID: <72DF18D5AC5748E3A23E6A9B0FE24358@PCGianvito> From: "Gianvito Pio" To: References: <5eca56860906050330w6171b327k95881b13c4dca466@mail.gmail.com> <4A294A00.5020802@gmail.com> <5eca56860906060010y4177b88apcf587d62f7286b5d@mail.gmail.com> In-Reply-To: Subject: Re: Type inheritance Date: Sat, 6 Jun 2009 16:18:57 +0200 MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset="iso-8859-1"; reply-type=original Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Windows Mail 6.0.6002.18005 X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6002.18005 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=STOX_REPLY_TYPE=0.001 X-Spam-Level: X-Archive-Number: 200906/28 X-Sequence-Number: 32633 Mhm...maybe. I need that thing for just 1 table... Have you seen the Oracle example? Do you know if I can do a similar thing in PostgreSQL? ----- Original Message ----- From: "Jasen Betts" Newsgroups: gmane.comp.db.postgresql.sql To: Sent: Saturday, June 06, 2009 2:04 PM Subject: Re: [SQL] Type inheritance > > On 2009-06-06, Gianvito Pio wrote: >> --001485f44bfe3e357c046ba8b3d6 >> Content-Type: text/plain; charset=ISO-8859-1 >> Content-Transfer-Encoding: 7bit >> >> Oh that was just an example...Let me make a real example: >> I have a table "Sensors" (that has to contain different sensor types) >> with >> a Value. That value doesn't have to be fixed, but I want to define it in >> a >> way that it changes its structure when the sensor type changes. For >> example, for Temperature sensor I would like to have just a float number, >> but for the humidity I could need of absolute and relative humidity >> (2 floats). I'd just like to know if I can say that the VALUE is a >> composite >> type...that I have then to specialize in Temp Type and Humidity >> type...using >> them in their particular case. > > this appears to be EAV in disguise. > > -- > Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-sql