Re: [HACKERS] check contraints incorrectly reject "null" - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] check contraints incorrectly reject "null"
Date
Msg-id 10053.944786176@sss.pgh.pa.us
Whole thread Raw
In response to check contraints incorrectly reject "null"  (Don Baccus <dhogaza@pacifier.com>)
List pgsql-hackers
Don Baccus <dhogaza@pacifier.com> writes:
> According to Date, a check contraint should fail if the expression
> evaluates to false.

And SQL92 says:
        A table check constraint is satisfied if and only if the specified        <search condition> is not false for
anyrow of a table.                              ^^^^^^^^^
 

so they agree: a constraint that yields NULL should be considered
to pass.  A tad nonintuitive, but who am I to argue...

I have fixed several bugs recently having to do with incorrect
evaluation of three-state boolean logic.  I'll take care of this one.
        regards, tom lane


pgsql-hackers by date:

Previous
From: wieck@debis.com (Jan Wieck)
Date:
Subject: Re: [HACKERS] Weired FK problem
Next
From: Peter Eisentraut
Date:
Subject: Re: [HACKERS] Parallel regress tests (was Re: FOREIGN KEY andshift/reduce)