Re: table has many to many relationship with itself - how

From: "Daniel McBrearty" <danielmcbrearty(at)gmail(dot)com>
To: "SCassidy(at)overlandstorage(dot)com" <SCassidy(at)overlandstorage(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: table has many to many relationship with itself - how
Date: 2006-06-14 22:14:42
Message-ID: 9cf113670606141514l31471f99s12a93af0f994b264@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

thanks Susan for your idea.

I thought that was it for a moment, then I saw a problem (I think) -
it works, but gets quite inefficient.

when you have 2 phrases which are a translation, that is just one entry

when you have 3, that is 3
4 => 6

and so on.

In practice we might have 15, 20 languages in a translation. It is
unlimited many-to-many.

So the problem is a bit to do this while keeping the solution efficient.

I am almost sold on just using

create table translaton (
id serial,
phrases integer[]
);

but afaik there is no way to tell pg that the array contains refs to
another table. I could still live with this though, if noone has a
better way.

regards

Daniel

--
Daniel McBrearty
email : danielmcbrearty at gmail.com
www.engoi.com : the multi - language vocab trainer
BTW : 0873928131

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Samad, Alex 2006-06-14 22:19:14 postgres and ldap
Previous Message Terry Lee Tucker 2006-06-14 21:48:44 Re: Performance Question