Re: Design question, Does postgres provide a simpler solution than the obvious? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Design question, Does postgres provide a simpler solution than the obvious?
Date
Msg-id 200210080954.01201.dev@archonet.com
Whole thread Raw
In response to Design question, Does postgres provide a simpler solution than the obvious?  (Greg Stark <gsstark@mit.edu>)
List pgsql-general
On Monday 07 Oct 2002 11:49 pm, Greg Stark wrote:
> I guess my ideal solution would allow me to issue an insert or update on
> the original table with some sort of associative array data structure as
> the value for the string field. The appropriate work would all get done
> automatically. Then selects would either return the associative array or
> perhaps even implement the entire logic for looking up the correct string
> to display.

Just to clarify, assuming the preferred language is French and the default
English, you want something like:

 id lang phrase
 73   FR bonjour
 73   EN hello
 74   EN goodbye

You then want to be able to do:

SELECT phrase FROM foo WHERE id=73 or 74;
 phrase
=======
bonjour
goodbye

Is this the sort of thing you're after?

--
  Richard Huxton

pgsql-general by date:

Previous
From: Savita
Date:
Subject: Re: How to find out about index
Next
From: "Erwan DUROSELLE"
Date:
Subject: Rép. : deadlock detected