DataError: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
The issue occurred as Odoo is attempting to create a PostgreSQL database with UTF-8 encoding. When creating new database, PostgreSQL database system works by copying an existing standard system database, namely template1 or template0. Thus template1 and/or template0 database is the “template” from which new databases are made, including the character set encoding, LC_CTYPE (character classification) and LC_COLLATE (collation string sort order) locale settings.
To fix the issue, convert the character set encoding and locale of the standard template databases to UTF-8. There are several ways to do so, as list below. Run the SQL queries in psql, the interactive terminal-based front-end to PostgreSQL.
To run psql, uses the following command if you have root access:
# su - postgres $ psql
Else, run this:
$ sudo -u postgres psql
$ sudo su - postgres psql