Re: advice on how to store variable attributes

From: Linos <info(at)linos(dot)es>
To: David Johnston <polobo(at)yahoo(dot)com>
Cc: "pgsql-sql(at)postgresql(dot)org" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: advice on how to store variable attributes
Date: 2011-10-22 17:14:05
Message-ID: 4EA2F9DD.2040106@linos.es
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 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.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Ferruccio Zamuner 2011-10-23 21:12:46 To having or not to having?
Previous Message David Johnston 2011-10-22 16:10:48 Re: advice on how to store variable attributes