Re: Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards - Mailing list pgsql-hackers

From Tom Ivar Helbekkmo
Subject Re: Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards
Date
Msg-id 86bsnywuj7.fsf@athene.i.eunet.no
Whole thread Raw
In response to Re: AW: Re: [SQL] behavior of ' = NULL' vs. MySQL vs. Stand ards  (Thomas Lockhart <lockhart@fourpalms.org>)
List pgsql-hackers
Thomas Lockhart <lockhart@fourpalms.org> writes:

> But since the construct is not allowed (or useless), why would
> anyone feel they need to use it?

Because it isn't entirely useless, actually.  I agree that no
programmer in his right mind would write, by hand, a comparison
involving NULL, knowing that the truth value of that comparison is
required by the standard to be UNKNOWN (i.e. NULL).  However, I'm
looking at using machine generated SQL code (generated on the fly in
an interactive application) to implement a dynamically adapting set of
tables, rules/triggers and their supporting stored procedures, and
it's just a matter of time before the first "= NULL" happens to show
up in code generated like that.  I'd like it to behave according to
the standard when that situation occurs, and the standard says that
any comparison with NULL, even "NULL = NULL", is UNKNOWN.

-tih
-- 
The basic difference is this: hackers build things, crackers break them.


pgsql-hackers by date:

Previous
From: "Roberto Abalde"
Date:
Subject: Is this a bug?
Next
From: Tom Lane
Date:
Subject: Re: Is this a bug?