Skip site navigation (1) Skip section navigation (2)

BUG #1367: Unique constraint fails with some values

From: "Hong Yuan" <hongyuan(at)homemaster(dot)cn>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #1367: Unique constraint fails with some values
Date: 2004-12-30 02:52:51
Message-ID: 200412300252.iBU2qpaO021934@developer.pgadmin.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      1367
Logged by:          Hong Yuan
Email address:      hongyuan(at)homemaster(dot)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.

Responses

pgsql-bugs by date

Next:From: Magnus HaganderDate: 2004-12-30 09:18:58
Subject: Re: German Win32 Setup (V8 RC2)
Previous:From: Tom LaneDate: 2004-12-30 00:20:05
Subject: Re: BUG #1364: using field names or table names with blanks

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group