#psql -d dsc
dsc=# insert into t values(1,'中国');
ERROR: invalid byte sequence for encoding "UTF8": 0xd6d0
HINT: This error can also happen if the byte sequence does not match the encoding expected by the server, which is controlled by "client_encoding".
dsc=# show client_encoding;
client_encoding
-----------------
UTF8
(1 row)
dsc=# show client_encoding;
client_encoding
-----------------
GBK
(1 row)
INSERT 0 1
dsc=# commit;
WARNING: there is no transaction in progress
COMMIT
dsc=# select * from t;
id | name
----+------
1 | 中国
(1 row)
[postgres@dsc ~]$ export PGCLIENTENCODING=GBK
[postgres@dsc ~]$ psql
psql: FATAL: conversion between GBK and LATIN1 is not supported
[postgres@dsc ~]$ psql -d dsc
psql (8.4.3)
Type "help" for help.
id | name
----+------
1 | 中国
(1 row)
INSERT 0 1
dsc=# select * from t;
id | name
----+----------
1 | 中国
2 | 我的中国
(2 rows)

[postgres@dsc ~]$ psql -d dsc
psql (8.4.3)
Type "help" for help.
id | name
----+----------
1 | 中国
2 | 我的中国
(2 rows)
INSERT 0 1
dsc=# select * from t;
id | name
----+----------
1 | 中国
2 | 我的中国
3 | 我的中国
(3 rows)