Re: [SQL] Problem with n to n relation

2001-10-09 Thread Janning Vygen
Am Dienstag, 9. Oktober 2001 17:38 schrieb Stephan Szabo: > > Yes you are right! It doesnt work. i thought i have tested it... > > > > But i dont understand your solution. Why did you insert foo in > > the person table? Dou want to use it as a foreign key? Maybe you > > just mistyped your alter t

Re: [SQL] Problem with n to n relation

2001-10-09 Thread Stephan Szabo
> Yes you are right! It doesnt work. i thought i have tested it... > > But i dont understand your solution. Why did you insert foo in the > person table? Dou want to use it as a foreign key? Maybe you just > mistyped your alter table statement i guess. you create a unique > person2address id a

Re: [SQL] Problem with n to n relation

2001-10-09 Thread Janning Vygen
Am Montag, 8. Oktober 2001 19:33 schrieb Stephan Szabo: > On Mon, 8 Oct 2001, Janning Vygen wrote: > > Am Montag, 8. Oktober 2001 18:09 schrieb Stephan Szabo: > > > On Mon, 8 Oct 2001, Janning Vygen wrote: > > > > but how do i reach my goal. It should not be allowed to have > > > > a person with

Re: [SQL] Problem with n to n relation

2001-10-08 Thread Stephan Szabo
On Mon, 8 Oct 2001, Janning Vygen wrote: > Am Montag, 8. Oktober 2001 18:09 schrieb Stephan Szabo: > > On Mon, 8 Oct 2001, Janning Vygen wrote: > > > > > but how do i reach my goal. It should not be allowed to have a > > > person without any address?? > > > > Hmm, do you always have at least on

Re: [SQL] Problem with n to n relation

2001-10-08 Thread Janning Vygen
Am Montag, 8. Oktober 2001 18:09 schrieb Stephan Szabo: > On Mon, 8 Oct 2001, Janning Vygen wrote: > > > but how do i reach my goal. It should not be allowed to have a > > person without any address?? > > Hmm, do you always have at least one known address at the time > you're inserting the perso

Re: [SQL] Problem with n to n relation

2001-10-08 Thread Stephan Szabo
On Mon, 8 Oct 2001, Janning Vygen wrote: > Am Freitag, 5. Oktober 2001 14:30 schrieb Morgan Curley: > > just get rid of the serial_id in person2adress -- there is no > > reason for it. Make the pk of that table a composite --> person_id, > > address_id <-- that way you have added some additional

Re: [SQL] Problem with n to n relation

2001-10-08 Thread Janning Vygen
Am Freitag, 5. Oktober 2001 14:30 schrieb Morgan Curley: > just get rid of the serial_id in person2adress -- there is no > reason for it. Make the pk of that table a composite --> person_id, > address_id <-- that way you have added some additional integrity to > your structure. Only one record ca

Re: [SQL] Problem with n to n relation

2001-10-05 Thread Morgan Curley
just get rid of the serial_id in person2adress -- there is no reason for it. Make the pk of that table a composite --> person_id, address_id <-- that way you have added some additional integrity to your structure. Only one record can exist ffor a given person at a given address. However any pers

[SQL] Problem with n to n relation

2001-10-05 Thread Janning Vygen
Hi, i create n to n relations like this, right? create table person ( idserial, name text ); create table address ( id serial, street text ... ); create table person2adress ( id serial, person_id integer not null references person(id), address_id integer not n