我试图用命令
将数据传输到我的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