Re: silly NULL question

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Dan Weeks <danimal(at)wildbrain(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: silly NULL question
Date: 2003-07-24 23:25:16
Message-ID: 1059089115.90090.8.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> Would return the row. Now with an upgrade to PostgreSQL 7.3 (yes, I know
> there are many changes and we're working through them right now) the same
> query returns nothing. Dropping the "AND parent_id = NULL" returns the row
> as expected.

NULL is similar to UNKNOWN.

So, NULL = NULL is the similar to UNKNOWN = UNKNOWN. Since you don't
know it, how can you tell if they're equal or not?

Syntax you're looking for is: AND parent_id IS NULL

If you really really really need = NULL (due to some MS product which
ignores SQL standards -- say MS Access) there is a toggle in the
postgresql.conf file to allow automated conversion of = NULL to IS NULL
within the server.

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Dan Weeks 2003-07-24 23:31:13 Re: silly NULL question
Previous Message Dan Weeks 2003-07-24 23:15:09 silly NULL question