Re: Should this require CASCADE? - Mailing list pgsql-hackers

From Christopher Kings-Lynne
Subject Re: Should this require CASCADE?
Date
Msg-id GNELIHDDFBOCMGBFGEFOIEBECDAA.chriskl@familyhealth.com.au
Whole thread Raw
In response to Re: Should this require CASCADE?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> > 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.

I think that an unqualified drop should restrict and fail to drop if there's
a foreign key.  Any app that lets people do a drop is probably already
checking for error conditions.  Hence, it's just another error condition.

Chris



pgsql-hackers by date:

Previous
From: Bradley Baetz
Date:
Subject: Re: [INTERFACES] [pgaccess-users] RE: bugzilla.pgaccess.org
Next
From: Tom Lane
Date:
Subject: Re: Should this require CASCADE?