Last Updated: February 25, 2016
·
1.282K
· trevorhinesley

Fix PostgreSQL after Homebrew Update (OS X Mavericks & upgrading to PostgreSQL 9.3 from PostgreSQL 9.2)

If you're trying to update Homebrew, update Postgres, or your lappy dies while your server is on and corrupts your very recently updated Postgres install, this is for you!

Steps to fix this using Terminal:

$ brew remove postgresql
$ brew install postgresql
$ cd /usr/local/var/
$ rm -rf postgres
$ initdb /usr/local/var/postgres
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start

Tada!