Re: bug or feature, || -operator and NULLs - Mailing list pgsql-hackers

From Markus Schaber
Subject Re: bug or feature, || -operator and NULLs
Date
Msg-id 4538CAAD.4060207@logix-tt.com
Whole thread Raw
In response to Re: bug or feature, || -operator and NULLs  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-hackers
Hi, Martijn,

Martijn van Oosterhout wrote:
> On Wed, Oct 18, 2006 at 11:36:44AM -0700, Jeff Davis wrote:
>>> What's being suggested simply violates common sense. Basically:
>>>
>>> if (a = b) then (a||c = b||c)
>>>
>> If a is 'x' and b is 'x' and c is NULL, the above statement doesn't hold
>> in PostgreSQL.
>
> Heh, well, c is supposed to be not NULL. Missed that. I was using the
> equals to include (NULL = NULL) but in SQL it's not like that.

Maybe you should replace "=" with "IS NOT DISTINCT FROM" :-)

HTH,
Markus

--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf.     | Software Development GIS

Fight against software patents in Europe! www.ffii.org
www.nosoftwarepatents.org


pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: Asynchronous I/O Support
Next
From: Markus Schaber
Date:
Subject: Re: Multiple postmaster + RPM + locale issues