Re: UNIQUE not honoured for NULL

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: David Newall <davidn-postgres(at)rebel(dot)net(dot)au>, PostgreSQL bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: UNIQUE not honoured for NULL
Date: 2004-07-07 19:25:52
Message-ID: 200407072125.52871.peter_e@gmx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

David Newall wrote:
> PostgreSQL version: 7.4.3 (RPMs from ftp.au.postgresql.org)
>
> Operating Sysem: Fedora Core 1
>
> CREATE TABLE t(i integer UNIQUE);
> INSERT INTO t VALUES (null);
> INSERT INTO t VALUES (null);
> SELECT coalesce(i,-999) FROM t;
> coalesce
> ----------
> -999
> -999
> (2 rows)

NULL = NULL is not true, so the rows are not equal.

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message James Antill 2004-07-07 19:29:58 Re: finding a max value
Previous Message Peter Eisentraut 2004-07-07 19:25:21 Re: Can't join on null values