Re: Documentation clairification?, CHECK constraints

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: "Karl O(dot) Pinc" <kop(at)meme(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-general(at)postgresql(dot)org
Subject: Re: Documentation clairification?, CHECK constraints
Date: 2004-05-19 23:10:57
Message-ID: 200405192310.i4JNAvG06185@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


OK, patch applied. Thanks.

---------------------------------------------------------------------------

Karl O. Pinc wrote:
>
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2004-05-19 23:49:12 Re: Unresponsive vacuum process
Previous Message Stefan 2004-05-19 23:07:45 Re: NFS performance tuning