Re:     H

From: "stevegy" <stevegy(at)126(dot)com>
To: "martijn van oosterhout" <kleptog(at)svana(dot)org>, "pgsql-general(at)postgr" <pgsql-general(at)postgresql(dot)org>
Subject: Re: &nbsp;&nbsp;&nbsp;&nbsp;H
Date: 2006-10-04 23:43:03
Message-ID: 45244707.00001E.15759@bj126app3.126.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Martijn,

I have changed the locale to LANG=zh_CN.UTF-8;export LANG first, stop the pgsql, and issue the command:
initdb -D ./data -E UTF8 --locale=zh_CN.UTF-8 --lc-collate=zh_CN.UTF-8 -U postgres -W
so i get a fresh new data cluster in this ./data, then I pg_ctl start -D ./data, psql to create the utf8 encoding database:

CREATE DATABASE "Recruit"
WITH OWNER = recruit
ENCODING = 'UTF-8'; -- the owner has been created before this sql

pg_restore -d Recruit ./backup/r2.tar

psql and \c Recruit
\encoding gb18030
-- i will not read the Chinese characters in client mode without this setting on my solaris 10, maybe there's something about the font mapping.

select cname from t_resume order by cname;
and then i get the wrong order result.

I really want to know why the server side encoding for GB18030 is not supported?


Thank you.



-- Steve Yao

-----原始邮件-----
发件人:"Martijn van Oosterhout"
发送时间:2006-10-04 22:35:41
收件人:"stevegy"
抄送:"pgsql-general(at)postgr"
主题:Re: [GENERAL] Hi,&nbs

On Wed, Oct 04, 2006 at 09:45:26PM +0800, stevegy wrote:

> So, now i stop the postgres: pg_ctl stop -D ./data_euc_cn and start

> it use the UTF-8 encoding data directory: pg_ctl start -D

> ./data_utf8. But the sort result for the Chinese characters is still

> wrong. And I notice that the sort result is diffrent from the

> LANG=zh_CN.GB18030.

You need to do more to change the encoding of a database. The encoding

is fixed at cluster-creation time, so you need to run initdb again to

actually change the locale/encoding.

Hope this helps,

--

Martijn van Oosterhout <kleptog(at)svana(dot)org> http://svana.org/kleptog/

> From each according to his ability. To each according to his ability to litigate.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2006-10-05 00:15:24 Re: Generating synthetic keys on copy
Previous Message Scott Ribe 2006-10-04 23:16:17 Generating synthetic keys on copy