Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 155FC2E3685 for ; Thu, 29 Nov 2007 08:46:52 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 53193-02-6 for ; Thu, 29 Nov 2007 08:46:40 -0400 (AST) Received: from proton.planetargon.com (proton.planetargon.com [198.145.115.11]) by postgresql.org (Postfix) with ESMTP id 50A032E3716 for ; Thu, 29 Nov 2007 08:46:38 -0400 (AST) Received: from [10.0.1.198] (c-67-165-16-168.hsd1.ct.comcast.net [67.165.16.168]) by proton.planetargon.com (Postfix) with ESMTP id 66E109521AD; Thu, 29 Nov 2007 04:46:11 -0800 (PST) In-Reply-To: References: <474404120711271804y21b8e0b3j7f4b3771c088a82a@mail.gmail.com> <17DF2022-C1D2-4D9E-ABAC-DC3F5B20FBE7@seespotcode.net> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: Cc: "Gera Mel Handumon" , pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: Michael Glaesemann Subject: Re: NULLIF problem Date: Thu, 29 Nov 2007 07:46:03 -0500 To: Erik Jones X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200711/151 X-Sequence-Number: 29679 On Nov 28, 2007, at 14:00 , Erik Jones wrote: > Why not just: > > UPDATE table > SET mytime=NULL > WHERE mytime=''; If mytime is a timestamp field, it won't have any values ''. I believe the OP is updating mytime to a client-supplied value which is passing '' when it probably means NULL. Michael Glaesemann grzm seespotcode net