narcisse
narcisse

Reputation: 451

PostgreSql: 'utf8' codec can't decode byte 0xe9 in position 42: invalid continuation byte

I recently installed PostgreSql and I am trying to create a new database. Unfortunetly I got and error while creating the database:

"'utf8' codec can't decode byte 0xe9 in position 42: invalid continuation byte" enter image description here

What is the problem exactly thank you

Upvotes: 14

Views: 25418

Answers (6)

Dmitrii
Dmitrii

Reputation: 1

The solution is very simple: find the postgresql.conf file on the server. In Windows, it is located here: C:/Program Files/PostgreSQL/16/data/postgresql.conf. Find the line with the lc_messages parameter. Replace the lines with:

lc_messages = 'English_United States.1252' 
lc_monetary = 'English_United States.1252'  
lc_numeric = 'English_United States.1252'   
lc_time = 'English_United States.1252'      
default_text_search_config = 'pg_catalog.english'

P.S: If the file is not in this location, then use the SHOW config_file; request on the server. This will show the path to the file.

Upvotes: 0

Anagramma
Anagramma

Reputation: 1

In my case, this error was due to non-English characters in the path to the date folder

Upvotes: 0

Sindre
Sindre

Reputation: 75

I tried all the solutions above. None worked.

The solution for me was to install US ENGLISH as my language on my windows 10. Then I did the installation all over again in that language.

It's working now, and I do not have use US ENGLISH as my windows language xD

Upvotes: 0

Walter D
Walter D

Reputation: 173

I had a similar error when upgrading from 4.5 to 4.7, the solution was to restart the pgAdmin server.

My error was: Error: 'utf-8' codec can't decode byte 0xe9 in position 0: invalid continuation byte

Upvotes: 2

Dotista
Dotista

Reputation: 431

It's a conflict between local languages. PgAdmin is in English but maybe in the conf file the lc_messages variable is French, Spanish or something else. Try this

lc_messages = 'en_US'

Upvotes: 0

zesage
zesage

Reputation: 49

Try to add the following line at the end of the pg_hba.conf file and then restart the PostgreSQL service:

host    all             all             all                 md5

Upvotes: 4

Related Questions