pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Linos <info@linos.es>
To: David Johnston <polobo@yahoo.com>
Cc: pgsql-sql@postgresql.org <pgsql-sql@postgresql.org>
Subject: Re: advice on how to store variable attributes
Date: Sat, 22 Oct 2011 19:14:05 +0200
Message-ID: <4EA2F9DD.2040106@linos.es> (raw)
In-Reply-To: <8B9FEA8A-D98D-4B5C-B957-2949A05DF9E6@yahoo.com>
References: <4EA29DDB.9000300@linos.es>
	<00655F1E-08DC-42C5-B702-C8D332081557@yahoo.com>
	<4EA2E3A8.8090203@linos.es>
	<8B9FEA8A-D98D-4B5C-B957-2949A05DF9E6@yahoo.com>

El 22/10/11 18:10, David Johnston escribió:
> 
> 
> SELECT ...
> FROM vendor_invoices
> JOIN ( SELECT ... FROM eav WHERE category = '' ) icm USING ( invoice_id )
> 
> Add a sub-query join for each desired category.
> 
> I agree HStore looks cleaner for the query example you give.  One apparent advantage is that since each record contains a single value you can use additional columns to store properties (e.g. Units) whereas the hstore makes that more difficult - though not impossible - since the keys are bot naturally related to each other.
> 
> From an output perspective hstore looks good.  If there are no difficulties on the data input process you might as well just go with it.  Given your volume and use-case it really isn't going to matter which option you pick; though I'd suggest providing views related to each major category with only the appropriate values and no access to the hstore column.
> 
> David J.
> 
> 

I will try with hstore and EAV both and see what seems more natural for me, i
have to take account how easy/clean it is to work with both from the Qt
application, i think eav would be much better to edit in a table.

Thanks to all for the replies.

Regards,
Miguel Angel.



view thread (10+ messages)

Message-ID: <4EA2F9DD.2040106@linos.es>
Permalink:  ../4EA2F9DD.2040106@linos.es/
Also on:    postgresql.org/message-id/4EA2F9DD.2040106@linos.es

 · 

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: info@linos.es, polobo@yahoo.com
  Subject: Re: advice on how to store variable attributes
  In-Reply-To: <4EA2F9DD.2040106@linos.es>

* 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