Re: [GENERAL] many to one of many modeling question

2008-01-11 Thread Richard Broersma Jr
--- On Fri, 1/11/08, David Fetter <[EMAIL PROTECTED]> 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 > databa

Re: [GENERAL] many to one of many modeling question

2008-01-11 Thread David Fetter
On Mon, Jan 07, 2008 at 12:30:50PM -0500, Kevin Hunter wrote: > 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

Re: [GENERAL] many to one of many modeling question

2008-01-08 Thread Sam Mason
On Mon, Jan 07, 2008 at 02:32:26PM -0500, Kevin Hunter wrote: > Something along the lines of > > CREATE TABLE o_1 ( id SERIAL ... ); > CREATE TABLE o_2 ( id SERIAL ... ); > CREATE TABLE o_3 ( id SERIAL ... ); > CREATE TABLE comments ( >id SERIAL, >obj_id INTEGER ... >FOREIGN KEY (obj_

Re: [GENERAL] many to one of many modeling question

2008-01-07 Thread Erik Jones
On Jan 7, 2008, at 6:00 PM, Richard Broersma Jr wrote: --- On Mon, 1/7/08, Erik Jones <[EMAIL PROTECTED]> wrote: From: Erik Jones <[EMAIL PROTECTED]> Subject: Re: [GENERAL] many to one of many modeling question To: "Richard Broersma Jr" <[EMAIL PROTECTED]> Cc: &quo

Re: [GENERAL] many to one of many modeling question

2008-01-07 Thread Richard Broersma Jr
--- On Mon, 1/7/08, Erik Jones <[EMAIL PROTECTED]> wrote: > From: Erik Jones <[EMAIL PROTECTED]> > Subject: Re: [GENERAL] many to one of many modeling question > To: "Richard Broersma Jr" <[EMAIL PROTECTED]> > Cc: "Postgres General List" , &

Re: [GENERAL] many to one of many modeling question

2008-01-07 Thread Erik Jones
On Jan 7, 2008, at 2:22 PM, Richard Broersma Jr wrote: CREATE TABLE comments ( id SERIAL, obj_id INTEGER ... FOREIGN KEY (obj_id) REFERENCES ONE OF o(id); Where are you guys getting this REFERENCES ONE OF stuff? Erik Jones DBA | Emma® [EMAIL PROTECTED] 800.595.4401 or 615.29

Re: [GENERAL] many to one of many modeling question

2008-01-07 Thread Richard Broersma Jr
--- On Mon, 1/7/08, Kevin Hunter <[EMAIL PROTECTED]> wrote: > :-( Yeah this is one method. I was hoping for something > cleaner though. > Something along the lines of > > CREATE TABLE o_1 ( id SERIAL ... ); > CREATE TABLE o_2 ( id SERIAL ... ); > CREATE TABLE o_3 ( id SERIAL ... ); > CREATE T

Re: [GENERAL] many to one of many modeling question

2008-01-07 Thread Kevin Hunter
At 2:09p -0500 on 07 Jan 2008, brian wrote: Kevin Hunter wrote: Is there a clever/clean way of having the comments foreign key into the multiple tables? If, by object, you mean that you have several tables, each row of which should be associated with one or more comments, the best way would b

Re: [GENERAL] many to one of many modeling question

2008-01-07 Thread brian
Kevin Hunter wrote: 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 thir

[GENERAL] many to one of many modeling question

2008-01-07 Thread Kevin Hunter
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