Re: R: Re: [HACKERS] Chinese in Postgres

From: Hannu Krosing <hannu(at)2ndQuadrant(dot)com>
To: "ciifrancesco(at)tiscali(dot)it" <ciifrancesco(at)tiscali(dot)it>
Cc: pgsql-hackers(at)postgresql(dot)org, pgsql-zh-general(at)postgresql(dot)org, pgsql-ru-general(at)postgresql(dot)org
Subject: Re: R: Re: [HACKERS] Chinese in Postgres
Date: 2013-08-16 12:45:13
Message-ID: 520E1ED9.7080703@2ndQuadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-ru-general pgsql-zh-general

On 08/16/2013 02:40 PM, ciifrancesco(at)tiscali(dot)it wrote:
> Thanks for your answer.
> Yes, the client is also UTF8:
>
> MyDB=# show
> client_encoding;
> client_encoding
> -----------------
> UTF8
> (1 row)
Strange, it works for me :

hannu(at)hannu-900X3E:~/workspace/my-app$ psql
psql (9.3beta2, server 9.2.4)
Type "help" for help.

hannu=# select * from pg_stat_activity;
hannu=# show client_encoding ;
client_encoding
-----------------
UTF8
(1 row)

hannu=# create table tchinese(data text);
CREATE TABLE
hannu=# insert into tchinese values('漢語1-3漢語');
INSERT 0 1
hannu=# select * from tchinese ;
data
-------------
漢語1-3漢語
(1 row)

hannu=# \q

Are you sure that the client-encoding is also the same when you are
actually doing the import ?

Or when you are getting the wrong results when reading

what does length() of the bad field give you ?

hannu=# select data, length(data) from tchinese ;
data | length
-------------+--------
漢語1-3漢語 | 7
(1 row)

--
Hannu Krosing
PostgreSQL Consultant
Performance, Scalability and High Availability
2ndQuadrant Nordic OÜ

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Song 2013-08-16 12:52:59 回复: [pgsql-zh-general] R: Re: [HACKERS] Chinese in Postgres
Previous Message ciifrancesco@tiscali.it 2013-08-16 12:40:09 R: Re: [HACKERS] Chinese in Postgres

Browse pgsql-ru-general by date

  From Date Subject
Next Message Song 2013-08-16 12:52:59 回复: [pgsql-zh-general] R: Re: [HACKERS] Chinese in Postgres
Previous Message ciifrancesco@tiscali.it 2013-08-16 12:40:09 R: Re: [HACKERS] Chinese in Postgres

Browse pgsql-zh-general by date

  From Date Subject
Next Message Song 2013-08-16 12:52:59 回复: [pgsql-zh-general] R: Re: [HACKERS] Chinese in Postgres
Previous Message ciifrancesco@tiscali.it 2013-08-16 12:40:09 R: Re: [HACKERS] Chinese in Postgres