When postgres database if no new encoding format, will use the default encoding format;
For existing database, although you can use: set client_encoding to 'UTF8'; set server_encoding to 'UTF8'; set the encoding format, but it restored to their original when you exit the client and then come in;
If you encounter a database migration data, import and export of database encoding format preferably the same, will complain otherwise migrate;
The method specifies the encoding format when creating a library postgres: create database db3 TEMPLATE template0 ENCODING 'SQL_ASCII';
Reference website: https://www.jianshu.com/p/62893363b0d2