| От | 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 по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера