many junction tables

From: Eric Kolve <ekolve(at)corp(dot)classmates(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: many junction tables
Date: 2001-09-04 14:52:59
Message-ID: 3B94EACB.3793CAA0@corp.classmates.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was wondering if anyone has a solution to the following problem. I
have a few tables similar to the following.

person_table

city_table

company_table

If I want to associate a person with a one or more cities. I need to
create a city_persons table that contains just the primary keys of both
the city_table and person_table. If I want to associate a person to
many companies, I have to do a similar thing. Now, if I wan to
generalize these associaes I can create something like an associate
table which will contain both id's plus two columns which indicate the
source and target tables of the relaionship. Does anyone have
suggestions along these lines on how to generalize such relationships?

thanks,

--eric

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruce Momjian 2001-09-04 15:00:30 Re: pg7.1 release date
Previous Message Stephan Bergmann 2001-09-04 14:46:23 Re: SHOW