在Windows上运行带有psql的SQL脚本会得到"EROR: character with byte sequence 0x9e in encoding " WIN1254 " has no eq



我试图用命令

将数据传输到我的PostgreSQL数据库
psql -h localhost -U postgres -d test -f C:file.sql

但是它给了我一个错误,像

EROR: character with byte sequence 0x9e in encoding "WIN1254" has no equivalent in encoding "UTF8"

我怎样才能解决这个问题?我使用Windows 10和Postgres版本12

您必须弄清楚文件的编码是什么。我们假设它是UTF-8。然后可以启动cmd.exe并输入:

set PGCLIENTENCODING=UTF8
psql -h localhost -U postgres -d test -f C:file.sql

相关内容

最新更新