| From: | Louis-David Mitterrand <vindex+lists-pgsql-sql(at)apartia(dot)org> |
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org |
| Subject: | Re: 'image' table with relationships to different objects |
| Date: | 2010-02-10 17:29:42 |
| Message-ID: | 20100210172942.GA10086@apartia.fr |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | 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,
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Justin Graf | 2010-02-10 19:07:39 | Re: 'image' table with relationships to different objects |
| Previous Message | Justin Graf | 2010-02-10 17:16:11 | Re: plpgsql loop question |