Re: BUG #5005: unique constraint considers nulls to be equal

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: BUG #5005: unique constraint considers nulls to be equal
Дата
Msg-id 20090824005701.GH5287@alvh.no-ip.org
обсуждение исходный текст
Ответ на BUG #5005: unique constraint considers nulls to be equal  ("Dean Schulze" <dean.w.schulze@comcast.net>)
Список pgsql-bugs
Dean Schulze wrote:

> Here are the duplicate records that violate this constraint:
>
> select county, year, idnumber, count(0) from table1 group by county, year,
> idnumber having (count(0) > 1) order by county, count(0);
>
>
> "county","year","idnumber","count"
> "AD",2009,"A57504",2
> "AD",2009,"A58395",2
> "AD",2009,"A58286",2
> "AD",2009,"A58299",2
> "AD",2009,"",5

What you have here seems to be an empty string, which is not the same as
a NULL value.  True NULLs behave as expected.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support

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

Предыдущее
От: "Dean Schulze"
Дата:
Сообщение: BUG #5005: unique constraint considers nulls to be equal
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: BUG #4999: select 'a' < 'A' is true, but should be false . . .