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 480D5565FA for ; Tue, 1 Mar 2005 12:32:49 +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 29290-09 for ; Tue, 1 Mar 2005 12:32:39 +0000 (GMT) Received: from net2.micro-automation.com (net2.micro-automation.com [64.7.141.29]) by svr1.postgresql.org (Postfix) with SMTP id 3808A56528 for ; Tue, 1 Mar 2005 12:32:38 +0000 (GMT) Received: (qmail 18378 invoked from network); 1 Mar 2005 12:31:45 -0000 Received: from dcdsl.ebox.com (HELO ?192.168.1.36?) (davec@64.7.143.116) by net2.micro-automation.com with SMTP; 1 Mar 2005 12:31:45 -0000 Message-ID: <422460E3.3040100@fastcrypt.com> Date: Tue, 01 Mar 2005 07:32:35 -0500 From: Dave Cramer Reply-To: pg@fastcrypt.com Organization: Postgres International User-Agent: Mozilla Thunderbird 1.0 (X11/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Oliver Jowett Cc: Guillaume Cottenceau , 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> <4224528A.3010606@opencloud.com> In-Reply-To: <4224528A.3010606@opencloud.com> 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.045 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200503/7 X-Sequence-Number: 12400 Well, if you are really intent on using this you can set transform_null_equals=true in postgresql.conf Dave Oliver Jowett wrote: > 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 > > ---------------------------(end of broadcast)--------------------------- > TIP 9: the planner will ignore your desire to choose an index scan if > your > joining column's datatypes do not match > > -- Dave Cramer http://www.postgresintl.com 519 939 0336 ICQ#14675561