Set New PostgreSQL Databases Encoding to Unicode

You must change encoding for template1. For do that run following.

UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
DROP DATABASE template1;
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';

#recomended
\c template1
VACUUM FREEZE;

via

Comments