Search Postgresql Archives

Re: many to one of many modeling question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



--- On Fri, 1/11/08, David Fetter <david@xxxxxxxxxx> 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 column a composite primary key.  

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

Regards,
Richard Broersma Jr.

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
       subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
       message can get through to the mailing list cleanly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux