Re: BUG #1367: Unique constraint fails with some values

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Hong Yuan" <hongyuan(at)homemaster(dot)cn>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1367: Unique constraint fails with some values
Date: 2004-12-31 04:09:18
Message-ID: 1487.1104466158@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

"Hong Yuan" <hongyuan(at)homemaster(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Magnus Hagander 2004-12-31 15:19:36 Re: BUG #1367: Unique constraint fails with some values
Previous Message Elvis E. Henriquez A. 2004-12-31 03:51:08 Wrong messages running on Windows - Part 2