Re: table has many to many relationship with itself - how - Mailing list pgsql-general

From Daniel McBrearty
Subject Re: table has many to many relationship with itself - how
Date
Msg-id 9cf113670606141514l31471f99s12a93af0f994b264@mail.gmail.com
Whole thread Raw
In response to Re: table has many to many relationship with itself - how  (SCassidy@overlandstorage.com)
List 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

pgsql-general by date:

Previous
From: Terry Lee Tucker
Date:
Subject: Re: Performance Question
Next
From: "John D. Burger"
Date:
Subject: DEFAULT_STATISTICS_TARGET