Search code examples
postgresqlencodingcharacter-encodingpgadmin-4

PotgreSQL- ERROR: invalid byte sequence for encoding "UTF8": 0xeb 0x6e 0x74


I am working on PostgreSQL and getting below error during insert statement execution from batch script(command line).

ERROR: invalid byte sequence for encoding "UTF8": 0xeb 0x6e 0x74

I have checked client_encoding by show client_encoding command and it is showing UTF-8.

Also checked database properties by using command

select * from pg_database where datname='<mydbName>'

In Output:

datcollate = English_United States.1252 datctype = English_United States.1252

How to resolve this issue?


Solution

  • If the three bytes quoted by the error message are supposed to encode the string “ënt”, you can solve your problem by setting the correct client encoding, e.g.

    SET client_encoding = WIN1252;