Re: Should this require CASCADE?
От | Rod Taylor |
---|---|
Тема | Re: Should this require CASCADE? |
Дата | |
Msg-id | 1026343668.62546.30.camel@jester обсуждение исходный текст |
Ответ на | Should this require CASCADE? (Tom Lane <tgl@sss.pgh.pa.us>) |
Список | pgsql-hackers |
On Wed, 2002-07-10 at 18:33, Tom Lane wrote: > Consider > > CREATE TABLE foo (f1 int primary key); > > CREATE TABLE bar (f1 int references foo); > > DROP TABLE foo RESTRICT; > Our historical behavior is to allow the drop, while issuing a notice > about implicit deletion of triggers. But I think SQL92 intends that > CASCADE should be required. I think you know my answer (Fail). - As stated, spec intends it to be required - Number of automated scripts doing drop table is small - Users will quickly learn the ropes. They would be surprised if it cascaded by default. The question I suppose is: DROP TABLE foo; Does it default to restrict or cascade? Currently it is restrict. I don't believe the spec allows those statements to be without the qualifier. Or, how about ALTER TABLE bar DROP CONSTRAINT <fkey_cons> RESTRICT; I forget what happens here -- does bar depend on foo via the fkey? ALTER TABLE foo DROP CONSTRAINT <primary key> RESTRICT; should definitely fail (bar depends on fkey which depends on foo.pkey).
В списке pgsql-hackers по дате отправления: