Address Table - Mailing list pgsql-novice

From Rudi Starcevic
Subject Address Table
Date
Msg-id 3EFB992F.2050503@oasis.net.au
Whole thread Raw
Responses Re: Address Table
Re: Address Table
Re: Address Table
List pgsql-novice
Josh,

>> But if addresses are dependant on parks, you simply use ON DELETE
>> CASCADE in your FK declaration, and when you delete a Park its addresses will
>> be automatically deleted.

I think I can only do this is I have the parks_table key in the parks_address table.

One other option, as Nabil suggested, is to have the foreign key the other way round.
Ie. the parks_address key in the parks_table.

Using Nabil's suggestion I wouldn't be able to cascade the delete into the parks_address table.
Thus leaving a lonely address.

So far I think we have discussed 3 solid and sensible options which are all correct SQL possibilities.

I'm just trying to get clear in my head which is the best for this senario.

Thanks
Rudi.






pgsql-novice by date:

Previous
From: M Spreij
Date:
Subject: enum, set
Next
From: Bruno Wolff III
Date:
Subject: Re: enum, set