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

From Hong Yuan
Subject BUG #1367: Unique constraint fails with some values
Date
Msg-id 200412300252.iBU2qpaO021934@developer.pgadmin.org
Whole thread Raw
Responses Re: BUG #1367: Unique constraint fails with some values
List pgsql-bugs
The following bug has been logged online:

Bug reference:      1367
Logged by:          Hong Yuan
Email address:      hongyuan@homemaster.cn
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.

pgsql-bugs by date:

Previous
From: Theodore Petrosky
Date:
Subject: Re: RC2 on OS X can not make check
Next
From: Tom Lane
Date:
Subject: Re: BUG #1367: Unique constraint fails with some values