Re: equal operator fails on two identical strings if initdb - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: equal operator fails on two identical strings if initdb
Date
Msg-id 200411241646.57709.peter_e@gmx.net
Whole thread Raw
In response to Re: equal operator fails on two identical strings if initdb  (Kent Tong <kent@cpttm.org.mo>)
Responses Re: equal operator fails on two identical strings if initdb
List pgsql-bugs
Kent Tong wrote:
> Is there any way to check?

On a POSIX system, you can do

$ LC_ALL=<some_locale> locale charmap

and verify manually that the printed charmap (= character set encoding)
matches what you use in PostgreSQL.  I don't know whether an equivalent
interface exists on Windows.

> I have other programs reading and writing Unicode on this
> computer without problems.

Reading and writing Unicode is not a problem.  But if you run the string
comparison operators, PostgreSQL passes the Unicode strings from your
database to the operating system's collation routines, which will
compare them thinking they are Big5 (or whatever) strings, which will
result in the random behavior you observed.  You need to set an
appropriate locale so that the operating system also thinks they are in
Unicode.

> Are you using the locale routines in mingw?

I believe we do.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/

pgsql-bugs by date:

Previous
From: "PostgreSQL Bugs List"
Date:
Subject: BUG #1328: psql don't accept some valid PGCLIENTENCODING values
Next
From: Tom Lane
Date:
Subject: Re: BUG #1328: psql don't accept some valid PGCLIENTENCODING values