Skip to content

Instantly share code, notes, and snippets.

@jeremyjbowers
Created February 11, 2015 16:32
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jeremyjbowers/9d6ae78ac12bdd87cf0e to your computer and use it in GitHub Desktop.
Save jeremyjbowers/9d6ae78ac12bdd87cf0e to your computer and use it in GitHub Desktop.
A quickie shell script for fixing your Postgres installation on a Mac when migrating from 9.3.5 to 9.4.1 via homebrew.
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
initdb /usr/local/var/postgres9.4 -E utf8
pg_upgrade -v \
-d /usr/local/var/postgres \
-D /usr/local/var/postgres9.4 \
-b /usr/local/Cellar/postgresql/9.3.5_1/bin/ \
-B /usr/local/Cellar/postgresql/9.4.1/bin/
mv /usr/local/var/postgres /usr/local/var/postgres9.3
mv /usr/local/var/postgres9.4 /usr/local/var/postgres
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment