Re: advice on setting up schema sought - Mailing list pgsql-novice

From Bruno Wolff III
Subject Re: advice on setting up schema sought
Date
Msg-id 20060411202933.GB17919@wolff.to
Whole thread Raw
In response to Re: advice on setting up schema sought  (<operationsengineer1@yahoo.com>)
Responses Re: advice on setting up schema sought
List pgsql-novice
On Tue, Apr 11, 2006 at 12:07:54 -0700,
  operationsengineer1@yahoo.com wrote:
>
>
> t_translations
> translations_id (pkey - composite of text_id and
> language_id with a marker such as "_" inbetween.
> otherwise 1 and 11 ("111") can be confused with 11 and
> 1 ("111").  unless someone has a better idea (which
> they likely do).
> translation (text)
>
> would this be an option?

No, you want to use the primary key declaration on the table, not the
column. Done that way you can specify more than one column as forming
the primary key.

> Bruno, do you even need a translations table?
> couldn't you just use...
>
> t_text
> text_id (pkey)
> is_base (bool)
> text (text)
>
> if the base text is all in one language, then you
> wouldn't even need the boolean (as long as that rule
> sticks, anyway).

This wouldn't solve the primary key issue, but it wouldn't unreasonable
to combine the primary text and translations together especially if the
primary text was always in a specific language.

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: Indexes slower when used in decending vs. ascending order?
Next
From: Alasdair Young
Date:
Subject: Re: Indexes slower when used in decending vs. ascending