Sean Chittenden <sean@chittenden.org> writes:
> test_pgsql=# SELECT COUNT(*) FROM test WHERE col2 NOTNULL;
> count
> -------
> 3
> (1 row)
> test_pgsql=# SELECT COUNT(*) FROM test WHERE col2 != NULL;
> count
> -------
> 0
> (1 row)
These are not the same thing. See any of the past discussions about
why "null = null" and "null != null" and so forth do not do what a
novice might expect.
regards, tom lane