Re: How would I store little key-Nr to text lists?

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: How would I store little key-Nr to text lists?
Дата
Msg-id AANLkTinXs4rT1hIuzG-uas7XU6Y3sYeL6aSPc1SqbvY_@mail.gmail.com
обсуждение исходный текст
Ответ на How would I store little key-Nr to text lists?  (Andreas <maps.on@gmx.net>)
Список pgsql-sql
2010/7/10 Andreas <maps.on@gmx.net>:
>  Hi
>
> how would I store little key-Nr  to  text  lists?
> Like e.g.
>
> colors
> 1  red
> 2  green
> 3  blue
>
> Maybe I later also need to add  4 yellow?
>
> Obviously the numbers are used for foreign keys in data tables and the texts
> appear in selects.
> On the other hand users should chose from listboxes in an application so I
> need to be able to read the (key, ext) tupels.
>
> For now I use 2 column tables that in selects get joined to a data table.
>
> Is there a more clever way ?

you can use enums, you can use a hstore contrib module, but what you
doing is best

regards

Pavel Stehule


>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql
>


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

Предыдущее
От: Andreas
Дата:
Сообщение: How would I store little key-Nr to text lists?
Следующее
От: "Campbell, Lance"
Дата:
Сообщение: subtract two dates to get the number of days