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
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@postgr"
主题:Re: [GENERAL] Hi,&nbsOn 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@xxxxxxxxx> http://svana.org/kleptog/ > From each according to his ability. To each according to his ability to litigate.
3G 时 代 来 临 了,坚 决 对 传 统 邮 箱 说 不 !
新 一 代 极 速 3G 邮 箱 闪 亮 登 场 ,280 兆 网 盘 免 费 送 ! 点 击 此 处 注 册