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