PostgreSQL使用\copy命令时报character with byte sequence 0xc3 0xa5 in encoding "UTF8" has no equivalent in encoding "GBK"

PostgreSQL大约 314 字

错误信息

ERROR:  character with byte sequence 0xc3 0xa5 in encoding "UTF8" has no equivalent in encoding "GBK"

解决方法

导出时指定encodingutf8

\copy (select * from test_table) to 'C:/data.csv' (FORMAT 'csv', DELIMITER ',', HEADER true, NULL 'UNKOWN', ENCODING 'UTF8')

参考

copy命令:https://www.postgresql.org/docs/11/sql-copy.html

阅读 2396 · 发布于 2019-08-07

————        END        ————

扫描下方二维码关注公众号和小程序↓↓↓

昵称:
随便看看换一批