Re: Design question, Does postgres provide a simpler solution than the obvious?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>, pgsql-general(at)postgresql(dot)org
Subject: Re: Design question, Does postgres provide a simpler solution than the obvious?
Date: 2002-10-08 08:54:01
Message-ID: 200210080954.01201.dev@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Erwan DUROSELLE 2002-10-08 09:12:17 Rép. : deadlock detected
Previous Message Savita 2002-10-08 08:44:18 Re: How to find out about index