Re: NULLIF problem

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Erik Jones <erik(at)myemma(dot)com>
Cc: "Gera Mel Handumon" <geramel(dot)h(at)gmail(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: NULLIF problem
Date: 2007-11-29 12:46:03
Message-ID: B98CA260-7332-4DB5-B4CF-462B5FB2C71D@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Christian Kindler 2007-11-29 13:01:59 statement-level trigger sample out there?
Previous Message Gera Mel Handumon 2007-11-29 09:43:38 Re: NULLIF problem