Forum OpenACS Q&A: Response to Notice: Found postgres7.2 incompatibility

Collapse
Posted by Don Baccus on
Not only is it non-standard but it is WRONG and MISLEADING.  It is very important to understand how three-valued logic works in SQL and disabling three-valued logic for one and only one operator is simply a bug.

foo = NULL returns true

foo < NULL returns NULL

See the inconsistency?  Three-valued logic is pervasive in SQL and implementors should never break it.  Making "foo = NULL" is an effort to hide three-valued logic from the user, and yes, I think it's access and I think it's because MS thought that hiding three-valued logic is easier than explaining it, and the "=" case is the one most non-sophisticated users will run into.

But you can't write complex SQL without fully understanding how three-valued logic works, and breaking standard SQL queries is not an aid to those writing portable code.  Which includes us, supporting multiple standard SQL RDBMS's is after all our goal!

Of course Oracle's "empty string = NULL in DML statements" is just as bad ...