Skip to content

Instantly share code, notes, and snippets.

@kcurtin
Last active August 29, 2015 14:06
Show Gist options
  • Save kcurtin/2ae85561d3c78bae9b15 to your computer and use it in GitHub Desktop.
Save kcurtin/2ae85561d3c78bae9b15 to your computer and use it in GitHub Desktop.
Upgrade postgres to 9.3 from 9.2.8
# Had some issues, so referenced these 3 solutions:
# https://gist.github.com/cjolly/2870054
# https://gist.github.com/cloud8421/6667898
# http://stackoverflow.com/questions/20754669/how-to-fix-postgres-after-updating-upgrading-brew
launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
pg_dumpall > ninedottwo-dump
# Not sure if this is necessary, but has to be cleared out no matter what for when we run initdb
# so you could also just rm the dir (this way will also back up that folder)
mv /usr/local/var/postgres/ /usr/local/var/postgres-9.2.8
brew tap petere/postgresql
brew upgrade postgresql
brew switch postgresql 9.3.4
initdb --locale=en_US -D /usr/local/var/postgres
createdb
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
psql < ninedottwo-dump
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment