Created
October 2, 2013 08:46
-
-
Save turboladen/6790847 to your computer and use it in GitHub Desktop.
Script for dealing with creating Postgres databases that complain with: ```
PG::InvalidParameterValue: ERROR: encoding UTF8 does not match locale en_US
DETAIL: The chosen LC_CTYPE setting requires encoding LATIN1.
```
...when trying to create the production DB. Taken from: http://stackoverflow.com/questions/13115692/encoding-utf8-does-not-match-…
This file contains 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
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'; |
Great, works!
It just works. Thanks!
Thanks, Man, that's just what I needed.
Thank you!
Thanks a lot.
awesome 😍
Noice!
Very Nice !
very good, thanks.
Thank you!
A Huge time saver for me. Thanks a lot!!!!!!!!!!!
save my day. thx!!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice one, did the trick .