Re: SET NULL on NOT NULL field

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
Cc: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>, Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: SET NULL on NOT NULL field
Date: 2003-01-28 16:45:29
Message-ID: 20030128164529.GA14694@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 27, 2003 at 21:23:01 -0800,
Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> wrote:
>
> On Tue, 28 Jan 2003, Christopher Kings-Lynne wrote:
>
> > I just noticed you can do this:
> >
> > create table blah (
> > a not null references test on delete set null
> > )
> >
> > Should that be prevented? It shouldn't be too hard to test for really...
>
> Maybe, although I don't think the spec prevents it. In practice
> I'd guess it ends up being a more expensive way of saying no action.

No. You end up not being able to delete the referenced keys. I tested
this in 7.3 and you get the following message when you try it:
ERROR: ExecUpdate: Fail to add null value in not null attribute col1

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Vivek Khera 2003-01-28 16:56:40 Re: Vacuum verbose output?
Previous Message Uros Gruber 2003-01-28 16:35:08 Re: tsearch comments