BUG #1046: UNIQUE INDEX BUG

Started by PostgreSQL Bugs Listover 22 years ago2 messagesbugs
Jump to latest
#1PostgreSQL Bugs List
pgsql-bugs@postgresql.org

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: PostgreSQL Bugs List (#1)
Re: BUG #1046: UNIQUE INDEX BUG

"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