Re: UNIQUE not honoured for NULL

Поиск
Список
Период
Сортировка
От Gaetano Mendola
Тема Re: UNIQUE not honoured for NULL
Дата
Msg-id ccu197$44b$1@floppy.pyrenet.fr
обсуждение исходный текст
Ответ на UNIQUE not honoured for NULL  (David Newall <davidn-postgres@rebel.net.au>)
Ответы Re: UNIQUE not honoured for NULL  (Bruno Wolff III <bruno@wolff.to>)
Список 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)

As someone says NULL = NULL is false
so that two rows are different. If you want enforce
only one null value for that column you have to write
you own trigger.



Regards
Gaetano Mendola

В списке pgsql-bugs по дате отправления:

Предыдущее
От: "PostgreSQL Bugs List"
Дата:
Сообщение: BUG #1190: Postgres/Jboss Synchronization
Следующее
От: Stephan Szabo
Дата:
Сообщение: Re: BUG #1190: Postgres/Jboss Synchronization