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 112355597D for ; Tue, 1 Mar 2005 09:05:36 +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 73864-10 for ; Tue, 1 Mar 2005 09:05:27 +0000 (GMT) Received: from mnc.ch (unknown [212.23.250.43]) by svr1.postgresql.org (Postfix) with ESMTP id BED995665E for ; Tue, 1 Mar 2005 09:05:25 +0000 (GMT) Received: (qmail 26660 invoked from network); 1 Mar 2005 10:05:25 +0100 Received: from 62-2-77-204.business.cablecom.ch (HELO meuh.mnc.ch) (62.2.77.204) by www.mnc.ch.com with SMTP; 1 Mar 2005 10:05:25 +0100 Received: by meuh.mnc.ch (Postfix, from userid 1000) id BBEFF23F50B; Tue, 1 Mar 2005 10:05:22 +0100 (CET) To: Oliver Jowett Cc: pgsql-jdbc@postgresql.org Subject: Re: impossible to update rows specifying columns with NULL value? References: <87wtssj2c4.fsf@meuh.mnc.ch> <42237EFA.1060502@opencloud.com> From: Guillaume Cottenceau Date: 01 Mar 2005 10:05:22 +0100 In-Reply-To: <42237EFA.1060502@opencloud.com> Message-ID: <87fyzfzqgd.fsf@meuh.mnc.ch> 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.053 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200503/3 X-Sequence-Number: 12396 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. With such situation, we can't use the same prepared-statement to match NULL and non-NULL values then, or I missed something? -- Guillaume Cottenceau