Re: 'image' table with relationships to different objects

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема Re: 'image' table with relationships to different objects
Дата
Msg-id 20100210172942.GA10086@apartia.fr
обсуждение исходный текст
Ответ на Re: 'image' table with relationships to different objects  (Rob Sargent <robjsargent@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Justin Graf
Дата:
Сообщение: Re: plpgsql loop question
Следующее
От: Justin Graf
Дата:
Сообщение: Re: 'image' table with relationships to different objects