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 AC5CC565DD for ; Mon, 28 Feb 2005 20:29:00 +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 42244-07 for ; Mon, 28 Feb 2005 20:28:57 +0000 (GMT) Received: from yass.opencloud.co.nz (yass.opencloud.co.nz [203.79.85.162]) by svr1.postgresql.org (Postfix) with ESMTP id CE4A2565B7 for ; Mon, 28 Feb 2005 20:28:55 +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 1D5rVa-0000bZ-00; Tue, 01 Mar 2005 09:28:50 +1300 Message-ID: <42237EFA.1060502@opencloud.com> Date: Tue, 01 Mar 2005 09:28:42 +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> In-Reply-To: <87wtssj2c4.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: 200502/211 X-Sequence-Number: 12391 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. See http://www.postgresql.org/docs/8.0/static/functions-comparison.html for details. -O