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

From Louis-David Mitterrand
Subject Re: 'image' table with relationships to different objects
Date
Msg-id 20100210172942.GA10086@apartia.fr
Whole thread Raw
In response to Re: 'image' table with relationships to different objects  (Rob Sargent <robjsargent@gmail.com>)
List pgsql-sql
On Tue, Feb 09, 2010 at 08:01:35AM -0700, Rob Sargent wrote:
> You can also invert this, making all the image owner share a common base
> table and then images are dependent on that base
> 
> base (id, type) where type is an enumeration or some such
> person (id, name, etc) where id is FK to base id
> locations (id, address, etc) where id is FK to base.id
> events(id, date, etc) where id is FK to base.id
> images(id, baseid) where baseid is FK to base.id
> 
> views across base to the "data" tables for easier sql if desired
> ORM: person location and event would inherit from base

This is intriguing. How do I manage the auto-incrementing 'id' serial on
children tables 'person', 'location' and 'event'?

Thanks,

-- 
http://www.critikart.net


pgsql-sql by date:

Previous
From: Justin Graf
Date:
Subject: Re: plpgsql loop question
Next
From: Justin Graf
Date:
Subject: Re: 'image' table with relationships to different objects