Search Postgresql Archives

Documentation clairification?, CHECK constraints

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux