Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id E88721337BC4 for ; Fri, 6 May 2011 02:08:11 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 86482-06 for ; Fri, 6 May 2011 05:07:54 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from zebedee.cranntara.net (zebedee.cranntara.net [91.186.7.79]) by mail.postgresql.org (Postfix) with ESMTP id 63D201337BB4 for ; Fri, 6 May 2011 02:07:53 -0300 (ADT) Received: from [88.210.188.180] (helo=bolek.coachhouse) by zebedee.cranntara.net with esmtpsa (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1QIDGZ-0006UW-UH for pgsql-sql@postgresql.org; Fri, 06 May 2011 06:07:52 +0100 Received: from dick.coachhouse ([192.168.1.32] ident=tarlika) by bolek.coachhouse with esmtp (Exim 4.69) (envelope-from ) id 1QIDF6-0006wT-0M for pgsql-sql@postgresql.org; Fri, 06 May 2011 06:06:20 +0100 Date: Fri, 6 May 2011 06:06:08 +0100 From: Tarlika Elisabeth Schmitz To: pgsql-sql@postgresql.org Subject: check constraint bug? Message-ID: <20110506060608.12bd24b0@dick.coachhouse> X-Mailer: Claws Mail 3.5.0 (GTK+ 2.12.12; i486-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-5 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201105/32 X-Sequence-Number: 35316 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); Can the expression not be bracketed? I changed this to: ALTER TABLE horse ADD CONSTRAINT val_horse_stats CHECK (sex != 'f') OR (stats IS NULL)); -- Best Regards, Tarlika Elisabeth Schmitz