pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kovacs Baldvin <kb136@hszk.bme.hu>
To: pgsql-sql@postgresql.org
Subject: Intentional, or bug?
Date: Sun, 16 Sep 2001 16:14:27 +0200 (MEST)
Message-ID: <Pine.GSO.4.33.0109161601050.10242-100000@ural2> (raw)

Hi!

I probably found an inconsistence of the working of the =
operator. Please read ahead, if you're interested.

I have two tables, let't call them a and b. They are:

a)
       x   |  y
-----------------------------
       1   |  100
       2   |  NULL

b)
       y   |  z
-----------------------------
       1   |  'hallelujah'
      NULL |  'hmm...'


Now let's issue this query:

select b.z from a,b where a.y=b.y;

The answer is: 'hallelujah', but it omits 'hmm...'.

Now let's issue the following:

select NULL = NULL;

The answer is: true!!!

My question is why does it omit the rows with NULL at the
first case?

However, I have a real life problem, when not all data is given in
a column, so I need a query to include the NULL=NULL rows. I can
workaround it as defining a new operator, ~=, with the
meaning "both null, or =". I did it, it works, but very slow.

So, is it an intentinal way of functioning, or it is bug somewhere?

Thanks,
Baldvin





view thread (4+ messages)  latest in thread

Message-ID: <Pine.GSO.4.33.0109161601050.10242-100000@ural2>
Permalink:  ../Pine.GSO.4.33.0109161601050.10242-100000@ural2/
Also on:    postgresql.org/message-id/Pine.GSO.4.33.0109161601050.10242-100000@ural2

 · 

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: kb136@hszk.bme.hu
  Subject: Re: Intentional, or bug?
  In-Reply-To: <Pine.GSO.4.33.0109161601050.10242-100000@ural2>

* 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