Address Table

From: Rudi Starcevic <rudi(at)oasis(dot)net(dot)au>
To: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Address Table
Date: 2003-06-27 01:09:03
Message-ID: 3EFB992F.2050503@oasis.net.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Bruno Wolff III 2003-06-27 01:16:37 Re: enum, set
Previous Message M Spreij 2003-06-27 01:04:45 enum, set