Skip to content

Instantly share code, notes, and snippets.

@ebinion
Last active March 3, 2016 17:23
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ebinion/5690817 to your computer and use it in GitHub Desktop.
Save ebinion/5690817 to your computer and use it in GitHub Desktop.
Update Postgres "template1"
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