Re: Should this require CASCADE?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Groff, Dana" <Dana(dot)Groff(at)filetek(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jan Wieck <JanWieck(at)Yahoo(dot)com>, Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Should this require CASCADE?
Date: 2002-07-11 16:27:30
Message-ID: 200207111627.g6BGRUn25041@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Groff, Dana wrote:
> I think that we are getting into two or three issues here. If I may:
>
> (1) Is DROP TABLE <foo> acceptable by the standard?
> (2) Should we break "old" functionality?
> (3) assuming we support the old syntax:
> should DROP TABLE <foo> be functionally the same as
> DROP TABLE <foo> RESTRICT
> (4) does that mean that That a DROP TABLE <foo> RESTRICT fails on
> foreign key reference to foo.
>
> Answers from my experience and from my reading of the standard. (See earlier
> note, I encourage you to determine if I am mistaken, the stand is often hard to
> read.)
>
> (1) It is ONLY acceptable (see conformance note) if you do not support
> CASCADE. If you support CASCADE, you must indicate CASCADE or RESTRICT. This
> isn't an "optional parameter". So, no -- the suggestion that "DROP TABLE <foo>"
> is now valid syntax given the CASCADE functionality breaks the standard.
> Vendors <sarcasm> occasionally </sarcasm> decide to break the standard.
> (currently the standards node seems to be down -- I was going to verify that
> nothing in 2004 has yet to change this syntax. That verification will have to
> come tomorrow (assuming it comes back up).)

Hard to argue why we should invalidate all preexisting SQL books by
rejecting DROP TABLE tab. If I create a table, and then want to drop
it, why should I have to put another noise word in there to make the
server happy. Now, if someone wanted to say CASCADE|RESTRICT was
required for DROP _only_ if there is some foreign key references to the
table, I would be OK with that, but that's not what the standard says.

Hard to imagine what the standards people were thinking on this one.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2002-07-11 16:36:06 Re: Should this require CASCADE?
Previous Message Kaare Rasmussen 2002-07-11 15:51:00 Re: I am being interviewed by OReilly