Re: '= NULL' is not the same as 'IS NULL'

From: Mark Morgan Lloyd <markMLl(dot)pgsql-odbc(at)telemetry(dot)co(dot)uk>
To: pgsql-odbc(at)postgresql(dot)org
Subject: Re: '= NULL' is not the same as 'IS NULL'
Date: 2006-09-06 20:40:50
Message-ID: 44FF3252.8F6A978B@telemetry.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-odbc

Geert Janssens wrote:

> I tried this query directly in phpPgSQL, and indeed it returns no results. On
> the other hand, if I modify "imgname" = NULL to "imgname" IS NULL, the query
> works fine.
[...]
> Has anybody else stumbled upon this issue ?

I'm afraid so, in Joe Celko's "SQL for Smarties" book, after which I simply
accepted that that was the way SQL worked. He also comments on the IS TRUE etc.
form which I see PostgreSQL now supports, also in the relevant section of the
manual I see IS DISTINCT FROM which might help.

--
Mark Morgan Lloyd
markMLl .AT. telemetry.co .DOT. uk

[Opinions above are the author's, not those of his employers or colleagues]

In response to

Responses

Browse pgsql-odbc by date

  From Date Subject
Next Message Richard Broersma Jr 2006-09-06 20:56:32 Re: '= NULL' is not the same as 'IS NULL'
Previous Message Dave Page 2006-09-06 18:55:29 Re: v08.02.0100 uploaded