Address Table

Поиск
Список
Период
Сортировка
От Rudi Starcevic
Тема Address Table
Дата
Msg-id 3EFB992F.2050503@oasis.net.au
обсуждение исходный текст
Ответы Re: Address Table  (Josh Berkus <josh@agliodbs.com>)
Re: Address Table  (Nabil Sayegh <postgresql@e-trolley.de>)
Re: Address Table  (Nabil Sayegh <nas@e-trolley.de>)
Список 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 по дате отправления:

Предыдущее
От: M Spreij
Дата:
Сообщение: enum, set
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: enum, set