Re: SET NULL / SET NOT NULL - Mailing list pgsql-hackers

From Stephan Szabo
Subject Re: SET NULL / SET NOT NULL
Date
Msg-id 20020325214602.E47891-100000@megazone23.bigpanda.com
Whole thread Raw
In response to Re: SET NULL / SET NOT NULL  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
On Tue, 26 Mar 2002, Christopher Kings-Lynne wrote:

> > Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:
> > > I have throught of at least two problems with changing nullability.  The
> > > first is primary keys.  I have to prevent people setting a
> > column involved
> > > in a PK to null, right?
> >
> > Probably so.
>
> And foreign keys - foreign keys only have to reference UNIQUE, right?  The
> nullability isn't an issue?

That should be fine.

> Lastly - in a multicolumn primary key, does EVERY column in the key need to
> be NOT NULL?

Well, it looks like the primary key will not be satisfied if any of the
values are NULL.

In my SQL 92 draft, 11.7 Syntax Rules 3a says:   If the <unique specification> specifies PRIMARY KEY, then let   SC be
the<search condition>:
 
                UNIQUE ( SELECT UCL FROM TN )                AND                ( UCL ) IS NOT NULL





pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Rolling v7.2.1 ...
Next
From: "Nicolas Bazin"
Date:
Subject: build of 7.2.1 on SCO Openserver and Unixware 7.1.1