Re: many to one of many modeling question

Поиск
Список
Период
Сортировка
От Richard Broersma Jr
Тема Re: many to one of many modeling question
Дата
Msg-id 193563.21773.qm@web31807.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Re: many to one of many modeling question  (David Fetter <david@fetter.org>)
Список pgsql-general
--- On Fri, 1/11/08, David Fetter <david@fetter.org> wrote:

> > One method
> > that has been proposed is to have a third table which
> stores to what object
> > type a comment belongs, but I don't like this
> because the foreign key
> > relationships then wouldn't be maintained by the
> database. The only way
> > that I'm able to think of at the moment is
> multiple columns.

Actually, I think if you notice the example I posted previously, I made both the Unique ID column and object type
columna composite primary key.   

The other tables referenced this composite primary key as foreign keys using referential integrity ON UPDATE CASCADE.
Thismeans that they database ~would~ maintain/enforce the object-type portion of the foreign key automatically for you. 

Regards,
Richard Broersma Jr.

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

Предыдущее
От: David Fetter
Дата:
Сообщение: Re: many to one of many modeling question
Следующее
От: Peter Wilson
Дата:
Сообщение: ECPG problem with 8.3