Re: Storing Pairs?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Charles Tassell <ctassell(at)isn(dot)net>
Cc: PostgreSQL-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Storing Pairs?
Date: 2000-05-15 15:20:53
Message-ID: 27113.958404053@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Charles Tassell <ctassell(at)isn(dot)net> writes:
> In a project I'm working on at the moment, I want to store multiple
> pieces of information about an item, and I'm looking for a good way to
> structure my tables. The items will have a variable number of descriptive
> attributes (ie, size, color, logo) so I was thinking of using arrays, but I
> don't think I can get the select options to work the way I want.

No, probably not --- and even if there were an "array search" kind of
operator, we don't have any indexes that would help. Use a variable
number of rows per entry, instead, with
item_name text
op_type int4
op_value int4
(or use an int4 key for the item, and store the name just once in a
different table...)

regards, tom lane

Browse pgsql-general by date

  From Date Subject
Next Message Janovszki Levente 2000-05-15 16:36:43 Re: CREATE FUNCTION problem
Previous Message Tom Lane 2000-05-15 15:13:46 Re: rtree indexes aren't being used with 7.0