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: 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 03:24:34
Message-ID: 200207110324.g6B3OYn29281@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:
> > As far as this question, seems with no RESTRICT/CASCADE, it fails, with
> > RESTRICT it drops the trigger, and with CASCADE it drops the referencing
> > table. Is that accurate?
>
> Not at all. CASCADE would drop the foreign key constraint (including
> the triggers that implement it), but not the other table. In my mind
> the issue is whether RESTRICT mode should do the same, or report an
> error.
>
> I'm not eager to accept the idea that DROP-without-either-option should
> behave in some intermediate fashion. I want it to be the same as
> RESTRICT.

Sounds good to me, and I don't think we need to require RESTRICT just
because the standard says so. Does the standard require RESTRICT for
every DROP or just drops that have foreign keys?

--
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 03:25:05 Re: [INTERFACES] [pgaccess-users] RE: bugzilla.pgaccess.org
Previous Message Tom Lane 2002-07-11 03:19:00 Re: Should this require CASCADE?