Skip to content

Instantly share code, notes, and snippets.

@tian-im
Last active April 2, 2020 14:28
Show Gist options
  • Save tian-im/99221184175090f36f5064a5f88ca6a0 to your computer and use it in GitHub Desktop.
Save tian-im/99221184175090f36f5064a5f88ca6a0 to your computer and use it in GitHub Desktop.
UTF8 template1 for Postgres db create
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
-- if it complains the locale name -- run `locale -a` to list all locale names in terminal
create database template1 with owner=postgres encoding='UTF-8' lc_collate='en_US.utf8' lc_ctype='en_US.utf8' template template0;
update pg_database set datistemplate=true where datname='template1';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment