Created
November 16, 2014 12:48
-
-
Save halilim/fafa3a3131e29af2a3a5 to your computer and use it in GitHub Desktop.
PostgreSQL recreate sequence craze - Homebrew Postgres, Y U NO collate tr_TR ?!
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
gem install lunchy | |
pg_dumpall > pg_all.sql | |
# Kill anything that access PostgreSQL before this, e.g. local rails server, pgAdmin etc | |
sudo lunchy stop homebrew.mxcl.postgresql | |
mv /usr/local/var/postgres{,.bak} | |
LC_CTYPE="tr_TR.UTF-8" initdb -E UTF-8 --locale=tr_TR --lc-collate=tr_TR --lc-ctype=tr_TR -D /usr/local/var/postgres/ | |
sudo lunchy start homebrew.mxcl.postgresql | |
psql -f pg_all.sql -d postgres | |
# Make sure pg_all.sql is safe and can be restored before this | |
rm -rf /usr/local/var/postgres.bak |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment