Re:    Hi,&nbs

From: "stevegy" <stevegy(at)126(dot)com>
To: "pgsql-general(at)postgr" <pgsql-general(at)postgresql(dot)org>
Subject: Re: &nbsp;&nbsp;&nbsp;Hi,&nbs
Date: 2006-10-04 13:45:26
Message-ID: 4523BAF6.0000AC.14484@bj126app4.126.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Martijn,

Thank you for the reply.

I think the locale settings is a diffrent in my case, and in the logical way, I guess the locale environs should be used by the program in the system C run-time library for the string operating functions such like comparing or something else like that.

I have login as user name 'postgres' and changed the LANG=zh_CN.UTF-8; export LANG and then the locale command output this:
========================================
-bash-3.00$ locale
LANG=zh_CN.UTF-8
LC_CTYPE="zh_CN.UTF-8"
LC_NUMERIC="zh_CN.UTF-8"
LC_TIME="zh_CN.UTF-8"
LC_COLLATE="zh_CN.UTF-8"
LC_MONETARY="zh_CN.UTF-8"
LC_MESSAGES="zh_CN.UTF-8"
LC_ALL=
========================================
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.

I think I still have not a direct way to solve this. Or, maybe, the postgres uses the locale settings from the other than the current postgres user?
Any suggestions?

-- Steve Yao

-----原始邮件-----
发件人:"Martijn van Oosterhout"
发送时间:2006-10-04 17:42:00
收件人:"stevegy"
抄送:pgsql-general(at)postgresql(dot)org
主题:Re: [GENERAL] Hi, ever

On Wed, Oct 04, 2006 at 07:50:12AM +0800, stevegy wrote:

> My testing database is initdb -E UTF8. And i guess the solaris can

> not handle the UTF-8 sorting with the LC_COLLATE="zh_CN.GB18030". But

> i need to prove this.

A locale can only handle one charset, usually the one given by "locale

charset". So if it handles sorting in GB18030 then by definition it

can't handle UTF-8.

> So i plan to change the locale of my solaris box. I have installed

> the zh_CN.UTF8 on it. I am looking for a way to change the solaris

> locale. If this changing need to re-boot machine that I should do

> this in some not busy time for the live application.

The locale is not a global setting. If you set the LANG or LC_ALL

variable, it will change the locale of any program run with that

environment variable. The default is the "C" locale.

Have a nice day,

--

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 A. Kretschmer 2006-10-04 14:00:52 Re: Fwd: Help with function
Previous Message Chris Hoover 2006-10-04 13:31:28 Fwd: Help with function