Re: check constraint bug? - Mailing list pgsql-sql

From Scott Marlowe
Subject Re: check constraint bug?
Date
Msg-id BANLkTimt7GMbEgkRtLvKFy+kK8KDOnn2Og@mail.gmail.com
Whole thread Raw
In response to check constraint bug?  (Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>)
Responses Re: check constraint bug?  (Lew <noone@lewscanon.com>)
List pgsql-sql
On Thu, May 5, 2011 at 11:06 PM, Tarlika Elisabeth Schmitz
<postgresql3@numerixtechnology.de> wrote:
> I specified:
>
> ALTER TABLE h ADD CONSTRAINT val_h_stats
> CHECK (NOT (sex = 'f') AND (stats IS NOT NULL));
>
> which was translated to:
>
> ALTER TABLE h ADD CONSTRAINT val_h_stats
> CHECK (NOT sex = 'f'::bpchar AND stats IS NOT NULL);

You need another level of parens:

CHECK (NOT ((sex = 'f') AND (stats IS NOT NULL)));


pgsql-sql by date:

Previous
From: Tarlika Elisabeth Schmitz
Date:
Subject: check constraint bug?
Next
From: Claudio Adriano Guarracino
Date:
Subject: Re: Select and merge rows?