"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