Documentation clairification?, CHECK constraints - Mailing list pgsql-general

From Karl O. Pinc
Subject Documentation clairification?, CHECK constraints
Date
Msg-id 20040331101908.A1749@mofo.meme.com
Whole thread Raw
Responses Re: Documentation clairification?, CHECK constraints
List pgsql-general
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

pgsql-general by date:

Previous
From: Nick Barr
Date:
Subject: Re: select statement sorting
Next
From: Julian North
Date:
Subject: Re: select statement sorting