X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 32CCC5612C for ; Mon, 14 Mar 2005 09:08:07 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 37982-01 for ; Mon, 14 Mar 2005 09:07:58 +0000 (GMT) Received: from websmtp2.mail.sohu.com (unknown [61.135.145.13]) by svr1.postgresql.org (Postfix) with ESMTP id DD8635638F for ; Mon, 14 Mar 2005 09:07:49 +0000 (GMT) Received: from mx37.mail.sohu.com (unknown [192.168.41.209]) by websmtp2.mail.sohu.com (Postfix) with ESMTP id C596577B254C for ; Mon, 14 Mar 2005 17:06:47 +0800 (CST) Message-ID: <13979541.1110791211578.JavaMail.postfix@mx37.mail.sohu.com> Date: Mon, 14 Mar 2005 17:06:51 +0800 (CST) From: "=?GB2312?B?va3OxA==?=" To: Subject: Do I have to change my Locale or database Encoding to enable LOWER() ? Mime-Version: 1.0 Content-Type: text/plain; charset="GB2312" Content-Transfer-Encoding: 8bit X-Mailer: Sohu Web Mail 2.0.13 X-SHIP: 12.47.224.13 X-Priority: 3 X-SHMOBILE: 0 X-Sohu-Antivirus: 0 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=2.758 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE, DNS_FROM_RFC_POST, DNS_FROM_RFC_WHOIS, FROM_ENDS_IN_NUMS X-Spam-Level: ** X-Archive-Number: 200503/319 X-Sequence-Number: 16817 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, 就知道了什么才是共产主义