Re: Table Constraints with NULL values

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Table Constraints with NULL values
Дата
Msg-id 11619.1003549897@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Table Constraints with NULL values  ("David Allardyce" <dave@pod13.net>)
Список pgsql-sql
"David Allardyce" <dave@pod13.net> writes:
> ... If they had defined uniqueness as "all rows
> must be distinct" then two all null rows would violate the uniqueness
> constraint.  Not the behavior I want at all.

Er, why not?  You're essentially arguing that the UNIQUE constraint
should treat nulls as equal, so I'd think two all-null rows should be
considered equal too.  I do not see how you can consistently maintain
that (x,NULL) equals (x,NULL) but (NULL,NULL) doesn't equal (NULL,NULL).

But we have been around the maypole on this question several times
before, with no permanent resolution --- the plain fact is that the
spec isn't very clearly written.  Useful data would be tests
demonstrating how other systems (Oracle, DB2, etc) interpret the issue.
        regards, tom lane


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

Предыдущее
От: "David Allardyce"
Дата:
Сообщение: Re: Table Constraints with NULL values
Следующее
От: "Dinesh Parikh"
Дата:
Сообщение: Query On Case structure