To be honest, I didn't expect that either. I guess with NULL meaning "absence of a value" the logic here is that since it cannot determine the value of NULL, it let's it pass. Why that was chosen over failing the check doesn't make sense to me.
MySQL 3.23.58 gives a syntax error on the table definition. MySQL 4.0.24 inserts the record fine -- but it also inserts (5, 4). i.e. it seems to ignore the check altogether. -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Wednesday, November 02, 2005 7:43 PM To: sqlite-users@sqlite.org Subject: Re: [sqlite] CHECK constraints "Marcus Welz" <[EMAIL PROTECTED]> wrote: > PostgreSQL 8.0 will happily insert (5, NULL). > Hmmm.. Not what I expected, nor what I implemented. But the implementation is easily changed and there is no point in trying to be "logical" about the behavior of NULLs, I've learned. I will probably modify SQLite to conform to PostgreSQL unless there is a serious outcry against this, or unless someone learns that PostgreSQL intends to change their behavior... I'm eager to hear what other RDBMSes do. -- D. Richard Hipp <[EMAIL PROTECTED]>