pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Richard Broersma <richard.broersma@gmail.com>
To: Gianvito Pio <pio.gianvito@gmail.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Type inheritance
Date: Sat, 6 Jun 2009 07:30:57 -0700
Message-ID: <396486430906060730t1afd39a9p49b056158b1d2194@mail.gmail.com> (raw)
In-Reply-To: <5eca56860906060010y4177b88apcf587d62f7286b5d@mail.gmail.com>
References: <5eca56860906050330w6171b327k95881b13c4dca466@mail.gmail.com>
	<4A294A00.5020802@gmail.com>
	<5eca56860906060010y4177b88apcf587d62f7286b5d@mail.gmail.com>

On Sat, Jun 6, 2009 at 12:10 AM, Gianvito Pio<pio.gianvito@gmail.com> wrote:

>  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.

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.


-- 
Regards,
Richard Broersma Jr.

Visit the Los Angeles PostgreSQL Users Group (LAPUG)
http://pugs.postgresql.org/lapug



view thread (13+ messages)  latest in thread

Message-ID: <396486430906060730t1afd39a9p49b056158b1d2194@mail.gmail.com>
Permalink:  ../396486430906060730t1afd39a9p49b056158b1d2194@mail.gmail.com/
Also on:    postgresql.org/message-id/396486430906060730t1afd39a9p49b056158b1d2194@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: richard.broersma@gmail.com, pio.gianvito@gmail.com
  Subject: Re: Type inheritance
  In-Reply-To: <396486430906060730t1afd39a9p49b056158b1d2194@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox