L
Lee Fesperman
Chris said:I can't point to a specific section of an ANSI specification. In fact,
if you know of a place where the ANSI SQL92 or SQL99 specs are publicly
available, that would be interesting. My understanding is that ANSI
holds the copyright and does not permit distribution.
It is very unfortunate that the specs are not available free. You can buy them, though,
from ANSI or an authorized reproducer. I bought my copy of SQL92 from Global Engineering
Documents.
I know it like the back of my hand and can say with confidence that that construct is
not included in SQL92.
I am instead making reference to Martin Gruber's "SQL Instant
Reference" and to observed behavior from PostgreSQL, which tends to be
at least approaching compliant with SQL92 (unlike some other free
databases... .
I know Martin very well (he dedicated his first book, "Understanding SQL", to me.)
I'd be disappointed if PostgreSQL supported it, because it is useless or at best
redundant ... IS [NOT] NULL was in SQL86. Perhaps it has something to do with
PostgreSQL's pre-1986 origins.
I'm curious, though. You seem to be implying that there is a difference
between "? = NULL" and "? = b" where b is NULL. Is there some reason
that the literal NULL is not allowed there? Was it disallowed
intentionally to prevent mistakes in SQL by people who don't understand
tri-value logic (and if so, doesn't it just invite subtler and more
difficult bugs?)
If ? = NULL were supported, then there should be no difference, and it would always
yield UNKOWN for compatibility with ? = b where b is NULL. That makes it completely
useless. So, I was guessing that its meaning could be like ? IS NULL.
I believe standard SQL disallows it to avoid misunderstandings, as related to 3VL. There
is the standard construct instead. As to subtle and deep bugs associated with 3VL and
NULLs, this is a really big topic. I participated in the "Great NULLs Debate" and have a
number of articles at firstsql.com. I come down on the side with Codd vs. Date, Pascal,
McGoveran, et al. I've debated it with all those guys (still do). However, I'd be the
first to say it's a very complex issue.