The following bug has been logged online: Bug reference: 1367 Logged by: Hong Yuan Email address: [EMAIL PROTECTED] PostgreSQL version: 8.0 Operating system: Windows XP Chinese Simplified Description: Unique constraint fails with some values Details:
I found that the unique constraint fails sometimes when the varchar column contain some specific Chinese characters. Here is an example: CREATE TABLE test ( col1 varchar(10), CONSTRAINT col1 UNIQUE (col1) ) WITHOUT OIDS; insert into test values('大'); insert into test values('大'); insert into test values('大'); While the second and third inserts should fail, they do not. With some other Chinese characters, the constraint is observed. The character '大' has utf-8 encoding '\xe5\xa4\xa7'. The database is created with UNICODE encoding. The problem is present with version 8.0.0-rc2. ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend