Re: BUG #1367: Unique constraint fails with some values - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #1367: Unique constraint fails with some values
Date
Msg-id 1487.1104466158@sss.pgh.pa.us
Whole thread Raw
In response to BUG #1367: Unique constraint fails with some values  ("Hong Yuan" <hongyuan@homemaster.cn>)
List pgsql-bugs
"Hong Yuan" <hongyuan@homemaster.cn> writes:
> I found that the unique constraint fails sometimes when the varchar column
> contain some specific Chinese characters. Here is an example:

The usual cause of this sort of thing is that you've selected a database
encoding that is not compatible with the locale setting you used during
initdb, causing strcoll() to produce bogus answers --- and since varchar
comparisons depend on strcoll(), that makes everything go south.

It would be good if we could enforce consistency between the two
settings, but at the moment it's on the user's shoulders to get it right
:-(

            regards, tom lane

pgsql-bugs by date:

Previous
From: "Hong Yuan"
Date:
Subject: BUG #1367: Unique constraint fails with some values
Next
From: "Magnus Hagander"
Date:
Subject: Re: BUG #1367: Unique constraint fails with some values