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

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Design question, Does postgres provide a simpler solution than the obvious?
Дата
Msg-id 200210080954.01201.dev@archonet.com
обсуждение исходный текст
Ответ на Design question, Does postgres provide a simpler solution than the obvious?  (Greg Stark <gsstark@mit.edu>)
Список 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 по дате отправления:

Предыдущее
От: Savita
Дата:
Сообщение: Re: How to find out about index
Следующее
От: "Erwan DUROSELLE"
Дата:
Сообщение: Rép. : deadlock detected