Re: many to one of many modeling question - Mailing list pgsql-general

From Richard Broersma Jr
Subject Re: many to one of many modeling question
Date
Msg-id 193563.21773.qm@web31807.mail.mud.yahoo.com
Whole thread Raw
In response to Re: many to one of many modeling question  (David Fetter <david@fetter.org>)
List 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 by date:

Previous
From: David Fetter
Date:
Subject: Re: many to one of many modeling question
Next
From: Peter Wilson
Date:
Subject: ECPG problem with 8.3