On Thu, May 5, 2011 at 11:06 PM, Tarlika Elisabeth Schmitz
<postgresql3(at)numerixtechnology(dot)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)));