Return-Path: postarch
Received: by postgres.Berkeley.EDU (5.61/1.29)
	id AA17843; Wed, 10 Jun 92 14:50:56 -0700
Message-Id: <9206102150.AA17843@postgres.Berkeley.EDU>
From: postarch (Postgres Mailing Archive)
Subject: Re: attribute != NULL in query
To: postgres@postgres.berkeley.edu
Sender: pg_adm@postgres.berkeley.edu
Reply-To: mer@postgres.berkeley.edu
In-Reply-To: Your message of "Mon, 01 Jun 92 13:46:47 PDT."
             <9206012046.AA00283@postgres.Berkeley.EDU> 
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 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 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
mer@postgres.berkeley.edu
