Re: advice on setting up schema sought

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: operationsengineer1(at)yahoo(dot)com
Cc: danmcb <danielmcbrearty(at)gmail(dot)com>, pgsql-novice(at)postgresql(dot)org
Subject: Re: advice on setting up schema sought
Date: 2006-04-11 20:29:33
Message-ID: 20060411202933.GB17919@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, Apr 11, 2006 at 12:07:54 -0700,
operationsengineer1(at)yahoo(dot)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.

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Alasdair Young 2006-04-11 20:40:52 Re: Indexes slower when used in decending vs. ascending
Previous Message Tom Lane 2006-04-11 20:24:32 Re: Indexes slower when used in decending vs. ascending order?