Re: 'image' table with relationships to different objects - Mailing list pgsql-sql

From Jasen Betts
Subject Re: 'image' table with relationships to different objects
Date
Msg-id hl0oa2$l1g$6@reversiblemaps.ath.cx
Whole thread Raw
In response to 'image' table with relationships to different objects  (Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>)
List pgsql-sql
On 2010-02-09, Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org> wrote:
> Hello,
>
> In my database I have different object types (person, location, event,
> etc.) all of which can have several images attached.

can one image be several people?

can one image be both event and location?

> What is the best way to manage a single 'image' table with relationships
> to (potentially) many different object types while keeping referrential
> integrity (foreign keys)?

probably several join tables 
image_location image_person image_event
with uniques and cascades where needed.


pgsql-sql by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: plpgsql loop question
Next
From: Louis-David Mitterrand
Date:
Subject: "left join" not working?