Re: Should this require CASCADE?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Groff, Dana" <Dana(dot)Groff(at)filetek(dot)com>, 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:46:06
Message-ID: 200207111646.g6BGk6d27556@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> writes:
> > 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.
>
> But in fact that is not different from what I propose to do. Consider
> what such a rule really means:
> * if no dependencies exist for the object, go ahead and delete.
> * if dependencies exist, complain.
> How is that different from "the default behavior is RESTRICT"?

No, I support your ideas. We are allowing RESTRICT to be the default.

What I was saying is that the standard _requiring_ RESTRICT or CASCADE
was really strange, and I could understand such a requirement only if
foreign keys existed on the table. Requiring it when no foreign keys
exist is really weird. I agree we should default to RESTRICT in all
cases.

--
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

Browse pgsql-hackers by date

  From Date Subject
Next Message Manfred Koizar 2002-07-11 16:47:03 Re: [HACKERS] please help on query
Previous Message Joe Conway 2002-07-11 16:44:34 Re: workaround for lack of REPLACE() function