Re: BUG #6048: TRUNCATE vs TRUNCATE CASCADE: misleading message - Mailing list pgsql-bugs

From Artiom Makarov
Subject Re: BUG #6048: TRUNCATE vs TRUNCATE CASCADE: misleading message
Date
Msg-id BANLkTin5M=Y-saC+REkBZEfpibhm-ghDOw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #6048: TRUNCATE vs TRUNCATE CASCADE: misleading message  (Alexey Klyukin <alexk@commandprompt.com>)
Responses Re: BUG #6048: TRUNCATE vs TRUNCATE CASCADE: misleading message
Re: BUG #6048: TRUNCATE vs TRUNCATE CASCADE: misleading message
List pgsql-bugs
2011/6/2 Alexey Klyukin <alexk@commandprompt.com>:

> What would you expect to happen for TRUNCATE .. CASCADE?
>
> One thing I find potentially surprising is that TRUNCATE CASCADE doesn't =
follow the semantics of 'ON DELETE' clause for the foreign key, i.e. it wou=
ld truncate the dependent table even with ON DELETE RESTRICT foreign key. D=
o we need a similar 'ON TRUNCATE' =A0FK clause?
>

Yes, cascade truncating taked place without ON DELETE RESTRICT
checking. No matter.
Either TRUNCATE must show message with full objects tree - correct
behavior like DROP, or TRUNCATE CASCADE should not delete anything
(strict constraint checking).

pgsql-bugs by date:

Previous
From: Marc Cousin
Date:
Subject: Re: collation problem on 9.1-beta1
Next
From: Alexey Klyukin
Date:
Subject: Re: BUG #6048: TRUNCATE vs TRUNCATE CASCADE: misleading message