Search Postgresql Archives

many to one of many modeling question

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

 



Hi List,

I have multiple objects to which I'd like to associate comments. I'd like this to be a many to one relationship, so that each object can have many different comments. The issue is how to have one comment table. 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.

Is there a clever/clean way of having the comments foreign key into the multiple tables?

Thanks,

Kevin

---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

              http://archives.postgresql.org/

[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