Skip to content

Instantly share code, notes, and snippets.

@halilim
Created November 16, 2014 12:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save halilim/fafa3a3131e29af2a3a5 to your computer and use it in GitHub Desktop.
Save halilim/fafa3a3131e29af2a3a5 to your computer and use it in GitHub Desktop.
PostgreSQL recreate sequence craze - Homebrew Postgres, Y U NO collate tr_TR ?!
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