From: Scott Marlowe <scott.marlowe@gmail.com>
To: Tarlika Elisabeth Schmitz <postgresql3@numerixtechnology.de>
Cc: pgsql-sql@postgresql.org
Subject: Re: check constraint bug?
Date: Thu, 5 May 2011 23:10:19 -0600
Message-ID: <BANLkTimt7GMbEgkRtLvKFy+kK8KDOnn2Og@mail.gmail.com> (raw)
In-Reply-To: <20110506060608.12bd24b0@dick.coachhouse>
References: <20110506060608.12bd24b0@dick.coachhouse>
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)));
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: scott.marlowe@gmail.com, postgresql3@numerixtechnology.de
Subject: Re: check constraint bug?
In-Reply-To: <BANLkTimt7GMbEgkRtLvKFy+kK8KDOnn2Og@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox