Home > Software design >  Running SQL script with psql on Windows gives "EROR: character with byte sequence 0x9e in encod
Running SQL script with psql on Windows gives "EROR: character with byte sequence 0x9e in encod

Time:12-08

I was trying to transfer data to my PostgreSQL database with the command

psql -h localhost -U postgres -d test -f C:\file.sql

but it gives me an error like

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

How can I solve this problem?. I used Windows 10 and Postgres version 12

CodePudding user response:

You'll have to figure out what the encoding of the file is. Let's assume it is UTF-8. Then you can start your cmd.exe and type:

set PGCLIENTENCODING=UTF8

psql -h localhost -U postgres -d test -f C:\file.sql
  • Related