pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Louis-David Mitterrand <vindex+lists-pgsql-sql@apartia.org>
To: pgsql-sql@postgresql.org
Subject: Re: 'image' table with relationships to different objects
Date: Wed, 10 Feb 2010 18:29:42 +0100
Message-ID: <20100210172942.GA10086@apartia.fr> (raw)
In-Reply-To: <4B7178CF.60502@gmail.com>
References: <20100209074909.GA11838@apartia.fr>
	<4B714E12.1090207@archonet.com>
	<4B7178CF.60502@gmail.com>

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



view thread (8+ messages)  latest in thread

Message-ID: <20100210172942.GA10086@apartia.fr>
Permalink:  ../20100210172942.GA10086@apartia.fr/
Also on:    postgresql.org/message-id/20100210172942.GA10086@apartia.fr

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: vindex+lists-pgsql-sql@apartia.org
  Subject: Re: 'image' table with relationships to different objects
  In-Reply-To: <20100210172942.GA10086@apartia.fr>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox