Re: partial "on-delete set null" constraint

Поиск
Список
Период
Сортировка
От Alban Hertroys
Тема Re: partial "on-delete set null" constraint
Дата
Msg-id 65343F13-8D73-48DA-BFC7-5653630FAD7A@gmail.com
обсуждение исходный текст
Ответ на Re: partial "on-delete set null" constraint  (Rafal Pietrak <rafal@ztk-rp.eu>)
Список pgsql-general
> On 03 Jan 2015, at 18:05, Rafal Pietrak <rafal@ztk-rp.eu> wrote:
> W dniu 03.01.2015 o 16:48, Alban Hertroys pisze:
>>> On 03 Jan 2015, at 15:20, Rafal Pietrak <rafal@ztk-rp.eu> wrote:
>>>
> [-------------------------]
>>> Yes. This is precisely the "semantics" I'm trying to put into the schema: after a username is "released" from
service,all it's messages become "from unknown user".... unless thoroughly investigated :) 
>> It also makes a foreign key reference unusable: There is no unique parent record to match it to, so what exactly are
youreferencing? 
>
> Nothing.
>
> That's precisely my point here. I'd like to have "objects" in mailboxes table left "hanging around" after it's
"disconnected"from service. FK acting like a power cord of a vacuum cleaner: when in service: hooked into the wall;
afterthat vacuum cleaner stays there, only disconnected (and the socket can be used by others). 

Then you should make that reference to maildomains(domain) also NULLable. Otherwise you aren’t referencing ‘nothing’,
butpossibly every user in the domain (we won’t know, since NULL is ‘unknown’ after all and that could match anything). 

Alban Hertroys
--
If you can't see the forest for the trees,
cut the trees and you'll find there is no forest.



В списке pgsql-general по дате отправления:

Предыдущее
От: Alban Hertroys
Дата:
Сообщение: Re: partial "on-delete set null" constraint
Следующее
От: Rafal Pietrak
Дата:
Сообщение: Re: partial "on-delete set null" constraint