Created
October 2, 2014 19:00
-
-
Save thanatos/62f85046777545c05dad to your computer and use it in GitHub Desktop.
Make PosgreSQL's "template1" database UTF-8
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1'; | |
| DROP DATABASE template1; | |
| CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UTF-8'; | |
| UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1'; | |
| GRANT CONNECT ON DATABASE template1 TO PUBLIC; | |
| REVOKE TEMPORARY ON DATABASE template1 FROM PUBLIC; | |
| \c template1 | |
| VACUUM FREEZE; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment