Subject: attribute != NULL in query

From: David Feldcamp <[email-masked]>
Date: Mon, 1 Jun 92 13:46:47 -0700

I am experiencing the problem that whenever I do a query in which one of there 'where'
conditions is of the form 'attribute != NULL' AND the class being queried against
is empty, the query crashes with the message:

Error: No response from the backend, exiting...

Is this a known problem?  Is this a valid query? (it works fine as long as there is
data in the class)

---

From: postarch (Postgres Mailing Archive)
Date: Wed, 10 Jun 92 14:50:33 PDT

you write:
> I am experiencing the problem that whenever I do a query in which one of ther
 +e 'where'
> conditions is of the form 'attribute != NULL' AND the class being queried aga
 +inst
> Is this a known problem?  Is this a valid query? (it works fine as long as th
 +ere is
> data in the class)

This is a known problem and will be fixed in version 4.  Going by the 'Gospel
According to Codd' the expression:

	where reln.attribute != NULL

should return NULL.  Any clause where one of the operator's arguments is a
NULL should always return NULL.  I believe sql (gulp - i hope i get this right)
defines something like the keywords 'ISNULL' and 'NOTNULL' that appear after
expressions:

	where reln.attribute ISNULL

or:

	where reln.attribute NOTNULL

Postgres Version 4 will provide the same functionality, putting the keywords
before the expression (we can't be exactly the same as that other query
language):

	where ISNULL reln.attribute

or:

	where NOTNULL reln.attribute

Jeff Meredith
[email-masked]