Re: Storing Pairs?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Storing Pairs?
Дата
Msg-id 27113.958404053@sss.pgh.pa.us
обсуждение исходный текст
Список pgsql-general
Charles Tassell <ctassell@isn.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Janovszki Levente
Дата:
Сообщение: Re: CREATE FUNCTION problem
Следующее
От: Jeff Hoffmann
Дата:
Сообщение: Re: rtree indexes aren't being used with 7.0