Re: Index not used with IS NULL

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Index not used with IS NULL
Дата
Msg-id 20830.1045543499@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Index not used with IS NULL  (Dennis Gearon <gearond@cvc.net>)
Список pgsql-general
Dennis Gearon <gearond@cvc.net> writes:
> so NULLs **DON'T** count in a unique index? You can have more than one
> NULL in a single column UNIQUE constraint? I guess I am showing my
> ignorance, I thought you could only have one.

Unique indexes enforce SQL92 unique constraints, which are defined by
the spec thusly (sec 4.10):

         A unique constraint is satisfied if and only if no two rows in
         a table have the same non-null values in the unique columns.

If this doesn't seem right to you, you have not grokked the concept of
NULL.  Two nulls are never "equal" per spec.

            regards, tom lane

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Index not used with IS NULL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Index not used with IS NULL