Re: How does PostgreSQL treat null values in unique - Mailing list pgsql-general

From Neil Conway
Subject Re: How does PostgreSQL treat null values in unique
Date
Msg-id 1049850484.1008.4.camel@tokyo
Whole thread Raw
In response to Re: How does PostgreSQL treat null values in unique composite  ("Jim C. Nasby" <jim@nasby.net>)
Responses Re: How does PostgreSQL treat null values in unique  ("Jim C. Nasby" <jim@nasby.net>)
List pgsql-general
On Tue, 2003-04-08 at 20:31, Jim C. Nasby wrote:
> Take note that there is no standard for how NULLs are handled in unique
> constraints, though.

On the contrary, there *is* a standard for this behaviour (namely, the
SQL standard). For example, section 4.18.2 of the SQL 200x draft
standard says:

"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_."

Some databases might not follow this part of the spec, but the standard
is pretty clear, AFAICS.

Cheers,

Neil


pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: How does PostgreSQL treat null values in unique composite
Next
From: john.murdoch@ig.com.br
Date:
Subject: Strange Error, with unique key