Multiple foreign keys to the same table

From: JORGE MALDONADO <jorgemal1960(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Multiple foreign keys to the same table
Date: 2014-07-23 17:54:25
Message-ID: CAAY=A7-L=NMY9fkGWDrdZmQWooGCRyeOr_dmUR4t1gXC3ERuzA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Hi,

I have a table which has 2 fields (among others): origin and destination.
Also, I have a single table that represents both origins and destinations.
If these 2 tables are to be related through foreign keys then both fields
in the first table will point to the second table. Is this a good practice
in database design? If not, what is a solution besides making 2 separate
tables out of the second one?

Respectfully,
Jorge Maldonado

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message David G Johnston 2014-07-23 18:24:10 Re: Multiple foreign keys to the same table
Previous Message Mike Swierczek 2014-07-23 14:30:25 Re: Help with a JOIN.