Can't join on null values

From: David Newall <davidn-postgres(at)rebel(dot)net(dot)au>
To: PostgreSQL bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Can't join on null values
Date: 2004-07-06 09:26:31
Message-ID: 1089105988.5002.12.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PostgreSQL version: 7.4.3 (RPMs from ftp.au.postgresql.org)

Operating Sysem: Fedora Core 1

CREATE TABLE t1 (i INTEGER, j INTEGER);
INSERT INTO t1 VALUES (1, NULL);
CREATE TABLE t2 AS SELECT * FROM t1;
SELECT * FROM t1 JOIN t2 USING (i, j);
i | j
---+---
(0 rows)

I believe the one row, which is identically present in both table,
should be selected. The problem occurs because of the NULL value.

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message David Newall 2004-07-06 10:40:51 UNIQUE not honoured for NULL
Previous Message SZŰCS Gábor 2004-07-06 08:58:47 Immutable function in index