Received: from localhost.localdomain (postgresql.org [64.49.215.8]) by localhost (Postfix) with ESMTP id 50C3E47703C for ; Thu, 27 Jun 2002 12:05:16 -0400 (EDT) Mailbox-Line: From rp@guests.deus.net Thu Jun 27 12:05:16 2002 Received: from jalapeno.crazydogs.org (unknown [212.78.70.100]) by postgresql.org (Postfix) with ESMTP id 7B43A477164 for ; Thu, 27 Jun 2002 11:02:09 -0400 (EDT) Received: from rp by jalapeno.crazydogs.org with local (Exim 3.35 #1 (Debian)) id 17Name-00038d-00 for ; Thu, 27 Jun 2002 16:02:08 +0100 Date: Thu, 27 Jun 2002 16:02:08 +0100 From: Richard Poole To: pgsql-sql@postgresql.org Subject: Re: CHECK clause doesn't work with CASE clause Message-ID: <20020627150207.GA10473@guests.deus.net> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.3.28i X-Spam-Status: No, hits=-1.6 required=5.0 tests=IN_REP_TO,X_NOT_PRESENT,UPPERCASE_25_50,NO_MX_FOR_FROM version=2.30 X-Spam-Level: X-Archive-Number: 200206/366 X-Sequence-Number: 8331 On Thu, Jun 27, 2002 at 11:52:54AM +0200, J?rg Holetschek wrote: > Hi folks, > > I have a problem with a CHECK clause that doesn't seem to work properly. The > CASE > WHEN ((focus <> NULL) AND (epilepsy_class = 'f')) THEN > TRUE > WHEN ((focus <> NULL) AND (epilepsy_class IN ('g', > 'n'))) THEN FALSE > END), The condition "focus <> NULL" can't ever come out true. You probably mean IS NOT NULL. Richard