Re: advice on how to store variable attributes - Mailing list pgsql-sql

From Linos
Subject Re: advice on how to store variable attributes
Date
Msg-id 4EA2F9DD.2040106@linos.es
Whole thread Raw
In response to Re: advice on how to store variable attributes  (David Johnston <polobo@yahoo.com>)
List pgsql-sql
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
containsa single value you can use additional columns to store properties (e.g. Units) whereas the hstore makes that
moredifficult - 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
welljust go with it.  Given your volume and use-case it really isn't going to matter which option you pick; though I'd
suggestproviding 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.


pgsql-sql by date:

Previous
From: David Johnston
Date:
Subject: Re: advice on how to store variable attributes
Next
From: Ferruccio Zamuner
Date:
Subject: To having or not to having?