pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: D'Arcy J.M. Cain <darcy@druid.net>
To: Andrew Sullivan <ajs@crankycanuck.ca>
Cc: pgsql-sql@postgresql.org
Subject: Re: Differentiate Between Zero-Length String and NULLColumn Values
Date: Tue, 30 Jan 2007 11:38:34 -0500
Message-ID: <20070130113834.fa8d09e0.darcy@druid.net> (raw)
In-Reply-To: <20070130142332.GA31905@phlogiston.dyndns.org>
References: <20070130131334.GD31676@phlogiston.dyndns.org>
	<45BF584F.A3DD.0030.0@indicator.be>
	<20070130142332.GA31905@phlogiston.dyndns.org>

On Tue, 30 Jan 2007 09:23:32 -0500
Andrew Sullivan <ajs@crankycanuck.ca> wrote:
> Hmm.  Well, I'm not an Oracle guy, so I don't really know.  All I
> know is that we occasionally get people coming from Oracle who are
> surprised by this difference.  What I've been _told_ is that '' and
> NULL are under some circumstances (maybe integers?) the same thing,
> whereas of course ' ' and NULL are not.  But since I'm not an Oracle
> user, people should feel free to ignore me :)

I don't have an Oracle installation here and I haven't used it much but
I wonder if they treat the following two statements differently.

   SELECT * FROM table WHERE column IS NULL;
   SELECT * FROM table WHERE column = NULL;

The latter violates the SQL spec and is not allowed by PostgreSQL
without setting a special flag.  Is it possible that Oracle accepts "="
against NULL and also treats it slightly differently?

-- 
D'Arcy J.M. Cain <darcy@druid.net>         |  Democracy is three wolves
http://www.druid.net/darcy/                |  and a sheep voting on
+1 416 425 1212     (DoD#0082)    (eNTP)   |  what's for dinner.



view thread (15+ messages)  latest in thread

Message-ID: <20070130113834.fa8d09e0.darcy@druid.net>
Permalink:  ../20070130113834.fa8d09e0.darcy@druid.net/
Also on:    postgresql.org/message-id/20070130113834.fa8d09e0.darcy@druid.net

 · 

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: darcy@druid.net, ajs@crankycanuck.ca
  Subject: Re: Differentiate Between Zero-Length String and NULLColumn Values
  In-Reply-To: <20070130113834.fa8d09e0.darcy@druid.net>

* 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