Skip to content

Instantly share code, notes, and snippets.

@chanmix51
Created October 14, 2014 16:24
Show Gist options
  • Save chanmix51/9de65b6290253cbb0280 to your computer and use it in GitHub Desktop.
Save chanmix51/9de65b6290253cbb0280 to your computer and use it in GitHub Desktop.
Creating an UTF-8 postgresql database template
update pg_catalog.pg_database set datistemplate = false where datname = 'template1';
drop database template1;
create database template1 template template0 encoding 'utf8' lc_collate 'fr_FR.utf8' lc_ctype 'fr_FR.utf8';
update pg_catalog.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