Re: WHERE <timestamp-val>=NULL malfunction in release 7.2

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Ingo Ciechowski <ciechowski(at)cis-computer(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: WHERE <timestamp-val>=NULL malfunction in release 7.2
Date: 2002-06-21 16:50:20
Message-ID: 20020621094717.E98706-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, 20 Jun 2002, Ingo Ciechowski wrote:

> Unfortunaly there's a (hopefully easy to fix) bug in release 7.2 and
> 7.2.1 that was not there in 7.1.3 and caused me to switch back today.

Nope. It's a bug fix.

> However - if you want to access a <timestamp>=NULL value, it is not found :-((
>
>
>
> i++=# select * from uri where freigegeben=NULL;
> template_id | content_id | freigegeben | gueltig_von | gueltig_bis |
> queue_status | site_id | uri
> -------------+------------+-------------+-------------+-------------+--------------+---------+-----
> (0 rows)

Which is correct because NULL does not equal NULL. Think of NULL as
an unknown value, you don't know if two NULLs are equal.

In 7.1, there was a parser hack to allow this due to some older clients
that expected it to work. In 7.2, you can turn this on with a variable
(TRANSFORM_NULL_EQUALS), however this behavior is contrary to the
SQL spec.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Bruno Wolff III 2002-06-21 17:13:42 Re: WHERE <timestamp-val>=NULL malfunction in release 7.2
Previous Message Tom Lane 2002-06-21 14:02:51 Re: [PATCHES] pg_dumpall should permit quiet operation