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

From: Andreas <maps(dot)on(at)gmx(dot)net>
To: postgres list <pgsql-sql(at)postgresql(dot)org>
Subject: How would I store little key-Nr to text lists?
Date: 2010-07-10 07:57:23
Message-ID: 4C3827E3.3080408@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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 ?

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Pavel Stehule 2010-07-10 09:02:23 Re: How would I store little key-Nr to text lists?
Previous Message Davor J. 2010-07-09 07:52:10 Re: Well-formed SQL check in postgres?