Skip to content

Instantly share code, notes, and snippets.

@rafaelbernard
Last active August 29, 2015 14:01
Show Gist options
  • Save rafaelbernard/ed096423a0b8e23d1345 to your computer and use it in GitHub Desktop.
Save rafaelbernard/ed096423a0b8e23d1345 to your computer and use it in GitHub Desktop.
PostgreSQL default template UTF-8
UPDATE pg_database SET datistemplate=FALSE WHERE datname='template1';
DROP DATABASE template1;
CREATE DATABASE template1
WITH owner=postgres template=template0 encoding='UTF8' LC_COLLATE='C' LC_CTYPE='C';
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