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

PostgreSQL About 308 words

错误信息

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')

参考

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

Views: 10,410 · Posted: 2019-08-07

————        END        ————

Give me a Star, Thanks:)

https://github.com/fendoudebb/LiteNote

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

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


Today On History
Browsing Refresh