X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 06ADB56527 for ; Tue, 1 Mar 2005 11:31:40 +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 15712-07 for ; Tue, 1 Mar 2005 11:31:31 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id 0048E564E8 for ; Tue, 1 Mar 2005 11:31:27 +0000 (GMT) Received: from 203-79-104-60.cable.paradise.net.nz ([203.79.104.60] helo=[192.168.0.20]) by yass.opencloud.co.nz with asmtp (Exim 3.35 #1 (Debian)) id 1D65b3-0002tU-00; Wed, 02 Mar 2005 00:31:25 +1300 Message-ID: <4224528A.3010606@opencloud.com> Date: Wed, 02 Mar 2005 00:31:22 +1300 From: Oliver Jowett User-Agent: Mozilla Thunderbird 1.0 (X11/20041228) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Guillaume Cottenceau Cc: pgsql-jdbc@postgresql.org Subject: Re: impossible to update rows specifying columns with NULL References: <87wtssj2c4.fsf@meuh.mnc.ch> <42237EFA.1060502@opencloud.com> <87fyzfzqgd.fsf@meuh.mnc.ch> In-Reply-To: <87fyzfzqgd.fsf@meuh.mnc.ch> X-Enigmail-Version: 0.89.5.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.005 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/4 X-Sequence-Number: 12397 Guillaume Cottenceau wrote: > Oliver Jowett writes: > > >>Guillaume Cottenceau wrote: >> >> >>>The problem is when trying to UPDATE (changing values of other >>>columns): my PreparedStatement uses "... WHERE column = ?" to >>>specify the NULL value for the said column, >> >>You can't do that and get the results you expect. "column = NULL" is >>never true (because "NULL = NULL" is false). You should use IS NULL to >>match a NULL value. > > It's a pity. This would be very helpful. Unfortunately, that's just the way that SQL NULLs work.. > With such situation, we > can't use the same prepared-statement to match NULL and non-NULL > values then, or I missed something? You are correct. -O