Do I have to change my Locale or database Encoding to enable LOWER() ?

From: 江文 <jiangwen365(at)sohu(dot)com>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: Do I have to change my Locale or database Encoding to enable LOWER() ?
Date: 2005-03-14 09:06:51
Message-ID: 13979541.1110791211578.JavaMail.postfix@mx37.mail.sohu.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin


Hello Hackers,
I store some information of manufacturing materials in a table, and in this table there's a column storing material's name. These names are mixed with Chinese characters and English characters.
To convert all English characters in material names into lower cases, I wrote a query: SELECT LOWER("ChineseDesc") FROM "Materials";

Then Postgres reported an error:
ERROR: invalid multibyte character for locale
HINT: The server's LC_CTYPE locale is probably incompatible with the database encoding.

After some googling I found out it's caused by the settings of LC_CTYPE & Encoding of the database.

Here's my db's settings:
My LC_CTYPE is set to Chinese_People's Republic of China.936 and I'm using UNICODE as this database's encoding.

But still I'm puzzled:
Which encoding to choose for my database or do I have to change my Locale setting? I prefer to stay with UNICODE, because I don't want to see my data clearly in PGAdmin 3 instead of *&^%$#@ .

Any suggestions will be appreicated!
Thanks in advance,

Henry

------------------------------------------
弄懂了PostgreSQL, 就知道了什么才是共产主义

Browse pgsql-admin by date

  From Date Subject
Next Message Gourish Singbal 2005-03-14 10:00:17 ERROR: for SELECT DISTINCT, ORDER BY expressions must appear in select list
Previous Message Mitchell Laks 2005-03-14 07:53:51 Re: Severe Badness On My Server: psql: FATAL: the database