many-to-many relationship

Поиск
Список
Период
Сортировка
От Louis-David Mitterrand
Тема many-to-many relationship
Дата
Msg-id 20081006130802.GA23018@apartia.fr
обсуждение исходный текст
Ответы Re: many-to-many relationship  (Dave Steinberg <dave-pgsql@redterror.net>)
Список pgsql-sql
Hi,

Say you have several objects (tables): person, location, event, etc. all
of which can have several images attached.

What is the best way to manage relations between a single 'image' table
and these different objects?

For now each 'image' row has pointers to id_person, id_location,
id_event, etc. (only one of which is used for any given row). 

Is there a better way, more elegant way to do it, without using
redundant id_* pointers on each row and yet still enforce foreign keys?

Thanks,

-- 
http://www.lesculturelles.net


В списке pgsql-sql по дате отправления:

Предыдущее
От: "Marc Mamin"
Дата:
Сообщение: Re: Query how-to
Следующее
От: Dave Steinberg
Дата:
Сообщение: Re: many-to-many relationship