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

Re: LATIN2 'bssz' and 'bszsz' fails on unique index

From: CoL <col(at)mportal(dot)hu>
To: pgsql-bugs(at)postgresql(dot)org
Subject: Re: LATIN2 'bssz' and 'bszsz' fails on unique index
Date: 2004-05-21 15:32:28
Message-ID: c8l7eh$g4r$ (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs

Tom Lane wrote:

 > =?ISO-8859-2?Q?S=FCn?= <sun(at)true(dot)hu> writes:
 >>If you use Latin2 encoding, you can not have 'bssz' and 'bszsz' in an
 >>unique column in the same time.
 > AFAICS this means that your locale definition considers these strings
 > equal.
 > It is possible that the real problem comes from using an encoding that's
 > not compatible with what the locale setting expects.  Locales generally
 > do require a specific character set encoding, though this is poorly
 > documented :-(

#createdb -U postgres -E=SQL_ASCII test
#psql test
test=# \encoding
test=# \l
List of databases
     Name     |   Owner    | Encoding
  test         | postgres   | SQL_ASCII

test=#  create TEMP table lala (string varchar(20));
test=# CREATE UNIQUE INDEX lala_idx on lala (string);
test=# insert INTO lala values ('bssz');
INSERT 757927 1
test=# insert INTO lala values ('bszsz');
ERROR:  duplicate key violates unique constraint "lala_idx"

How? Ok, its locale "bug" (not just int LATIN2, LATIN1), but why?


In response to

pgsql-bugs by date

Next:From: PAvilesDate: 2004-05-21 20:15:07
Subject: A memory leak. Postgres 7.4. Mac OS. X Server
Previous:From: Tom LaneDate: 2004-05-21 14:15:48
Subject: Re: int4, int8, real ....division...

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