set client_encoding = 'utf8';
create table intl_data (id int4, "コラム" text);
insert into intl_data values (1, 'リモートデータ');
+set client_encoding = 'sjis';
select * from intl_data order by 1;
- id | コラム
+ id | \83R\83\89\83\80
----+----------------
- 1 | リモートデータ
+ 1 | \83\8a\83\82\81[\83g\83f\81[\83^
(1 row)
set client_encoding = 'euc_jp';
1 | ¥ê¥â¡¼¥È¥Ç¡¼¥¿
(1 row)
+set client_encoding = 'utf-8';
+select * from intl_data order by 1;
+ id | コラム
+----+----------------
+ 1 | リモートデータ
+(1 row)
+
-- test
\c test_enc_proxy
set client_encoding = 'utf8';
create function test_encoding() returns setof intl_data as $$
cluster 'testcluster'; run on 0; select * from intl_data order by 1;
$$ language plproxy;
+set client_encoding = 'sjis';
+select * from test_encoding();
+ id | \83R\83\89\83\80
+----+----------------
+ 1 | \83\8a\83\82\81[\83g\83f\81[\83^
+(1 row)
+
set client_encoding = 'euc_jp';
select * from test_encoding();
id | ¥³¥é¥à
1 | リモートデータ
(1 row)
-set client_encoding = 'sjis';
-select * from test_encoding();
- id | \83R\83\89\83\80
-----+----------------
- 1 | \83\8a\83\82\81[\83g\83f\81[\83^
-(1 row)
-
\c template1
set client_min_messages = 'warning';
drop database if exists test_enc_proxy;
set client_encoding = 'utf8';
create table intl_data (id int4, "コラム" text);
insert into intl_data values (1, 'リモートデータ');
+set client_encoding = 'sjis';
select * from intl_data order by 1;
- id | コラム
+ id | \83R\83\89\83\80
----+----------------
- 1 | リモートデータ
+ 1 | \83\8a\83\82\81[\83g\83f\81[\83^
(1 row)
set client_encoding = 'euc_jp';
1 | ¥ê¥â¡¼¥È¥Ç¡¼¥¿
(1 row)
+set client_encoding = 'utf-8';
+select * from intl_data order by 1;
+ id | コラム
+----+----------------
+ 1 | リモートデータ
+(1 row)
+
-- test
\c test_enc_proxy
set client_encoding = 'utf8';
create function test_encoding() returns setof intl_data as $$
cluster 'testcluster'; run on 0; select * from intl_data order by 1;
$$ language plproxy;
+set client_encoding = 'sjis';
+select * from test_encoding();
+ id | \83R\83\89\83\80
+----+----------------
+ 1 | \83\8a\83\82\81[\83g\83f\81[\83^
+(1 row)
+
set client_encoding = 'euc_jp';
select * from test_encoding();
id | ¥³¥é¥à
1 | ¥ê¥â¡¼¥È¥Ç¡¼¥¿
(1 row)
-set client_encoding = 'utf8';
+set client_encoding = 'utf-8';
select * from test_encoding();
id | コラム
----+----------------
1 | リモートデータ
(1 row)
-set client_encoding = 'sjis';
-select * from test_encoding();
- id | \83R\83\89\83\80
-----+----------------
- 1 | \83\8a\83\82\81[\83g\83f\81[\83^
-(1 row)
-