many-to-many relationship - Mailing list pgsql-sql

From Louis-David Mitterrand
Subject many-to-many relationship
Date
Msg-id 20081006130802.GA23018@apartia.fr
Whole thread Raw
Responses Re: many-to-many relationship  (Dave Steinberg <dave-pgsql@redterror.net>)
List pgsql-sql
Hi,

Say you have several objects (tables): person, location, event, etc. all
of which can have several images attached.

What is the best way to manage relations between a single 'image' table
and these different objects?

For now each 'image' row has pointers to id_person, id_location,
id_event, etc. (only one of which is used for any given row). 

Is there a better way, more elegant way to do it, without using
redundant id_* pointers on each row and yet still enforce foreign keys?

Thanks,

-- 
http://www.lesculturelles.net


pgsql-sql by date:

Previous
From: "Marc Mamin"
Date:
Subject: Re: Query how-to
Next
From: Dave Steinberg
Date:
Subject: Re: many-to-many relationship