Re: Documentation clairification?, CHECK constraints

From: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Documentation clairification?, CHECK constraints
Date: 2004-03-31 18:27:47
Message-ID: 20040331122747.I1749@mofo.meme.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On 2004.03.31 10:53 Tom Lane wrote:
> "Karl O. Pinc" <kop(at)meme(dot)com> writes:
> > 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.
>
> Correct --- this is per spec.
>
> > Yes? Should this be clarified in the documentation?
>
> Sure, send a documentation patch.

--- create_table.sgml Wed Mar 31 12:57:02 2004
+++ create_table.sgml.new Wed Mar 31 13:16:55 2004
@@ -383,11 +383,14 @@
<para>
The <literal>CHECK</> clause specifies an expression producing a
Boolean result which new or updated rows must satisfy for an
- insert or update operation to succeed. A check constraint
- specified as a column constraint should reference that column's
- value only, while an expression appearing in a table constraint
- may reference multiple columns.
+ insert or update operation to succeed. Expressions evaluating
+ to TRUE or UNKNOWN succeed. Should any row of an insert or
+ update operation produce a FALSE result an error exception is
+ raised and the insert or update does not alter the database. A
+ check constraint specified as a column constraint should
+ reference that column's value only, while an expression
+ appearing in a table constraint may reference multiple columns.
</para>
<para>

Karl <kop(at)meme(dot)com>
Free Software: "You don't pay back, you pay forward."
-- Robert A. Heinlein

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Diogo Biazus 2004-03-31 18:30:20 Re: Wich hardware suits best for large full-text indexed
Previous Message Mooney, Ryan 2004-03-31 18:08:26 Re: Large DB