Re: many junction tables - Mailing list pgsql-general

From Arne Weiner
Subject Re: many junction tables
Date
Msg-id 3B9500F5.E9F97B12@gmx.de
Whole thread Raw
In response to many junction tables  (Eric Kolve <ekolve@corp.classmates.com>)
List pgsql-general
I don't understand what exactly your problem is. What
what makes me unsure is: why do you want to store the
target table names in the association table?

Eric Kolve wrote:
>
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly

pgsql-general by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] getting the oid for a new tuple in a BEFORE
Next
From: Bruce Momjian
Date:
Subject: Re: [WAY OT] Re: PL/java?