点击上方“IT那活儿”公众号--专注于企业全栈运维技术分享,不管IT什么活儿,干就完了!!!
报错现象
Caused by: org.panweidb.util.PSQLException: ERROR: character with byte sequence 0xc20xa0in encoding "UTF8" has no equivalent in encoding "GBK"
报错分析
--查看客户端字符集是UTF8
aaadb1=> show client_encoding ;
+-----------------+
| client_encoding |
+-----------------+
| UTF8 |
+-----------------+
(1 row)
--查看数据库字符集是GBK
aaadb1=> show server_encoding ;
+-----------------+
| server_encoding |
+-----------------+
| GBK |
+-----------------+
(1 row)
aaadb1=> \i test1.sql
gsql:test1.sql:2: ERROR: character with byte sequence 0xc2 0xa0 in encoding "UTF8"hasno equivalent in encoding "GBK"
aaadb1=> \encoding GBK
aaadb1=> show client_encoding ;
+-----------------+
| client_encoding |
+-----------------+
| GBK |
+-----------------+
(1 row)
aaadb1=> \i test1.sql
gsql:test1.sql:2: ERROR: invalid byte sequence for encoding "GBK": 0x800xe6
aaadb1=> selectcount(*) from test1;
+-------+
| count |
+-------+
| 27439 |
+-------+
aaadb1=> \i test1.sql
test1ERT 01
aaadb1=> selectcount(*) from test1;
+-------+
| count |
+-------+
| 27440 |
+-------+
隐患排查

问题总结

本文作者:辛志梁(上海新炬中北团队)
本文来源:“IT那活儿”公众号

文章转载自IT那活儿,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




