Re: Schema design question - Mailing list pgsql-general

From Ron Mayer
Subject Re: Schema design question
Date
Msg-id 47F09508.7070707@cheapcomplexdevices.com
Whole thread Raw
In response to Schema design question  (Ben <bench@silentmedia.com>)
List pgsql-general
Ben wrote:
> I'm working on a project which requires me to keep track of objects,
> each of which can have an arbitrary number of attributes. Although there
> will be many attributes that an object can have,...
> Anyway, this seems like a common problem without a perfect solution, and
> I'm sure people must have hindsight opinions on how they solved it. Your
> thoughts?

If each attribute can only occur once for any object, and if your
queries are based more on exact matches of the values rather than
range queries, you might want to look into the hstore module:
http://www.postgresql.org/docs/current/static/hstore.html

If attributes can occur more than once, you might even want to
serialize the whole object as some text format (yaml, xml, etc)
instead.





pgsql-general by date:

Previous
From: Ivan Sergio Borgonovo
Date:
Subject: Re: shortcut for select * where id in (arrayvar)
Next
From: Stuart Brooks
Date:
Subject: ANALYZE getting dead tuple count hopelessly wrong