Skip to content

Instantly share code, notes, and snippets.

@iapilgrim
Forked from turboladen/psql_encoding.sql
Created May 15, 2014 08:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iapilgrim/dfb7acb3006fa8d0a86c to your computer and use it in GitHub Desktop.
Save iapilgrim/dfb7acb3006fa8d0a86c to your computer and use it in GitHub Desktop.
sudo su postgres
psql
update pg_database set datistemplate=false where datname='template1';
drop database Template1;
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