weird results from trivial SELECT statement

From: Lonni J Friedman <netllama(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: weird results from trivial SELECT statement
Date: 2011-04-27 16:25:36
Message-ID: BANLkTin9RXicvNbbmDK_-bfxu6b=rmWZmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Greetings,
I've got a Postgresql-8.4.x instance with a bunch of tables taht have
a text column (called 'active') that can contain any one of the
following values:
NULL
'disabled'
<some other text string>

When I run the following query, it seems to ignore NULL values:
SELECT * FROM mytbl WHERE active!='disabled'

and only returns rows where active!='disabled' AND active IS NOT NULL.
Is postgresql implicitly assuming that I want non-NULL values?

I can provide additional information, if requested.

thanks!

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Oliveiros d'Azevedo Cristina 2011-04-27 16:47:09 Re: weird results from trivial SELECT statement
Previous Message Grzegorz Szpetkowski 2011-04-27 15:29:03 Server statistics