En este video tutorial se muestra cómo solucionar el error de PostgreSQL “Database creation error: new encoding (UTF8)” este error es muy común durante la creación de bases de datos dentro de PostgreSQL, en mi caso el error me sucedió durante la instalación de OdooERP.

Comandos para solucionar el error Database creation error: new encoding (UTF8)

postgres@odoo:~$ psql
psql (9.4.12)
Type "help" for help.
postgres=# UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
UPDATE 1
postgres=# DROP DATABASE template1;
DROP DATABASE
postgres=# CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';
CREATE DATABASE
postgres=# UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
UPDATE 1
postgres=# \c template1
You are now connected to database "template1" as user "postgres".
template1=# VACUUM FREEZE;
VACUUM
template1=# \q
postgres@odoo:~$

Por Juan Pablo

Ingeniero en Sistemas, amante del Software Libre y las Seguridad Informática, con más de 5 años de experiencia en el área de las Tic´s.

4 comentarios en «Solución PostgreSQL – Database creation error: new encoding (UTF8) is incompatible with the encoding of the template database»
  1. Hi can you give me a hand on it ?
    I have the same error, but I have no ideia where to type the commands.
    I am running a MacOs and PgAdmin 4 for the DB.
    How Can I fix it?

    Thanks in advance.

    Alan

    1. Hi, sure, I use Linux so the commands I ran were in the linux but you can run the same commands on your mac.

      Just go into postgres and type the commands in your mac terminal.

      Remember make a backup of you DB.

Deja un comentario