Thread: BUG #1046: UNIQUE INDEX BUG

BUG #1046: UNIQUE INDEX BUG

From
"PostgreSQL Bugs List"
Date:
The following bug has been logged online:

Bug reference:      1046
Logged by:          Alfonso Baqueiro

Email address:      abaqueirob@hotmail.com

PostgreSQL version: 7.3.2

Operating system:   Linux Redhat 9.0

Description:        UNIQUE INDEX BUG

Details:

create table pru(
  id integer not null primary key,
  login varchar(10) unique not null
);

then when inserting values it says á = é = í = ó = ú
(confuses different acuted vowels as if they were the same thing)

insert into pru (0, 'á');
-- no problem

But the error shows when trying the next:
insert into pru (1, 'é');
-- ERROR: cannot insert a duplicate key into unique index ...

Is a horrible bug that stops my migration from Centura SQLBase to PostgreSQL

Re: BUG #1046: UNIQUE INDEX BUG

From
Tom Lane
Date:
"PostgreSQL Bugs List" <pgsql-bugs@postgresql.org> writes:
> then when inserting values it says á = é = í = ó = ú
> (confuses different acuted vowels as if they were the same thing)

Sounds to me like you have selected the wrong character set (encoding)
or wrong locale when installing the database.  If Postgres thinks those
strings are equal, it is because the strcoll() library routine says so.
You need to pick a locale that will behave the way you want.

            regards, tom lane