Skip to content

Instantly share code, notes, and snippets.

@codyjroberts
Created May 19, 2015 21:12
Show Gist options
  • Save codyjroberts/e7272eabd635dde0dda9 to your computer and use it in GitHub Desktop.
Save codyjroberts/e7272eabd635dde0dda9 to your computer and use it in GitHub Desktop.
Make postgres default to UTF8
source: https://coderwall.com/p/j-_mia/make-postgres-default-to-utf8
UPDATE pg_database SET datistemplate=FALSE WHERE datname='template1';
DROP DATABASE template1;
CREATE DATABASE template1 WITH owner=postgres template=template0 encoding='UTF8';
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