Re: [HACKERS] check contraints incorrectly reject "null"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Don Baccus <dhogaza(at)pacifier(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] check contraints incorrectly reject "null"
Date: 1999-12-10 00:36:16
Message-ID: 10053.944786176@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Don Baccus <dhogaza(at)pacifier(dot)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 any row 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

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 1999-12-10 01:28:29 Re: [HACKERS] Parallel regress tests (was Re: FOREIGN KEY andshift/reduce)
Previous Message Jan Wieck 1999-12-10 00:27:41 Re: [HACKERS] Weired FK problem