Re: http://www.postgresql.org/docs/7.4/static/sql-createtable.html "The CHECK clause specifies an expression producing a Boolean result which new or updated rows must satisfy for an insert or update operation to succeed."
But SQL has 3 valued logic (strictly speaking, not boolean). It seems that the CHECK clases fail only when the expression result is FALSE, and pass when the result is either TRUE or UNKNOWN.
Yes? Should this be clarified in the documentation?
Somewhere along the line IIRC the rule that UNKNOWN always causes the code inside the THEN conditional to be skipped, so explicit tests for NULL are often needed as a 'special case'. Not that this has much to do with CHECK clauses, but I don't see the conditionals page for plpgsql saying anything about UNKNOWN values.
Maybe the section to describe how conditionals treat UNKNOWN is 9.1, conditional operators?
Karl <kop@meme.com> Free Software: "You don't pay back, you pay forward." -- Robert A. Heinlein
---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html