pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rod Taylor <rbt@rbt.ca>
To: Dan Weeks <danimal@wildbrain.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: silly NULL question
Date: 24 Jul 2003 19:25:16 -0400
Message-ID: <1059089115.90090.8.camel@jester> (raw)
In-Reply-To: <16160.26749.931319.656882@underdog.wildbrain.com>
References: <16160.26749.931319.656882@underdog.wildbrain.com>

> 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.

Attachments:

  signature.asc (application/pgp-signature, 186B) download

view thread (3+ messages)  latest in thread

Message-ID: <1059089115.90090.8.camel@jester>
Permalink:  ../1059089115.90090.8.camel@jester/
Also on:    postgresql.org/message-id/1059089115.90090.8.camel@jester

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: rbt@rbt.ca, danimal@wildbrain.com
  Subject: Re: silly NULL question
  In-Reply-To: <1059089115.90090.8.camel@jester>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox