Skip to content

Instantly share code, notes, and snippets.

@andyh
Forked from ebinion/gist:5690817
Created September 25, 2013 09:49
Show Gist options
  • Save andyh/6697426 to your computer and use it in GitHub Desktop.
Save andyh/6697426 to your computer and use it in GitHub Desktop.
UPDATE pg_database SET datallowconn = TRUE where datname = 'template0';
\c template0
UPDATE pg_database SET datistemplate = FALSE where datname = 'template1';
drop database template1;
create database template1 with template = template0 encoding = 'UNICODE' LC_CTYPE = 'en_US.UTF-8' LC_COLLATE = 'C';
UPDATE pg_database SET datistemplate = TRUE where datname = 'template1';
\c template1
UPDATE pg_database SET datallowconn = FALSE where datname = 'template0';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment