X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 7ECA33A631B for ; Sat, 11 Dec 2004 17:26:15 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 87299-05 for ; Sat, 11 Dec 2004 17:26:13 +0000 (GMT) Received: from stark.xeocode.com (gsstark.mtl.istop.com [66.11.160.162]) by svr1.postgresql.org (Postfix) with ESMTP id 93D9B3A630A for ; Sat, 11 Dec 2004 17:26:12 +0000 (GMT) Received: from localhost ([127.0.0.1] helo=stark.xeocode.com) by stark.xeocode.com with smtp (Exim 3.36 #1 (Debian)) id 1CdB0B-0005Qw-00; Sat, 11 Dec 2004 12:25:51 -0500 To: Ian Barwick Cc: Stephan Szabo , Kenneth Gonsalves , pgsql-sql@postgresql.org Subject: Re: replacing mysql enum References: <04121110305520.21547@thenilgiris.com> <1d581afe04121104255557ea@mail.gmail.com> <20041211074227.J30051@megazone.bigpanda.com> <1d581afe041211090628da57e@mail.gmail.com> In-Reply-To: <1d581afe041211090628da57e@mail.gmail.com> From: Greg Stark Organization: The Emacs Conspiracy; member since 1992 Date: 11 Dec 2004 12:25:50 -0500 Message-ID: <87llc44uht.fsf@stark.xeocode.com> Lines: 18 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.047 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200412/65 X-Sequence-Number: 19685 Ian Barwick writes: > What I still don't quite understand is why IN in a CHECK context is > handled differently to say: select 1 where 'x' in (null,'a','b','c') ? > This could be a bit of a gotcha for anyone constructing a constraint > similar to the original poster's and not realising it has no effect. well WHERE foo IN (null, ...) returns null if foo isn't explicitly in the list (ie, "it may or may not equal the unknown value in the list"). And I think constraints that return null are deemed to have succeeded. -- greg