Skip to content

Instantly share code, notes, and snippets.

@ndrluis
Forked from turboladen/psql_encoding.sql
Created April 18, 2014 15:40

Revisions

  1. @turboladen turboladen created this gist Oct 2, 2013.
    10 changes: 10 additions & 0 deletions psql_encoding.sql
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,10 @@
    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';