Postgresql via homebrew vs. mountain lion OS X

richsinn picture richsinn · Sep 24, 2012 · Viewed 9.7k times · Source

This is bothering me to no end.

I'm setting up a Rails 3.2 environment with Postgresql on my Mac with OS 10.8.2 (Mountain Lion).

I basically followed the directions in the Railscast, and installed postgresql version 9.2.0 via Homebrew. but whenever I do

which psql

and

psql --version

it always shows me the location and version of the system postgresql that came preinstalled with Mountain Lion (/usr/bin/psql and version 9.1.4, respectively), rather than the location and version of the Postgresql that I installed with Homebrew (/usr/local/bin and version 9.2.0, respectively).

I also set up a Launch Agent, so that postgresql automatically starts up when I start the system.

I've even tried following the directions from this blog, and I still get the same results when I run which psql.

However, when I do:

ps -ef | grep postgres

I receive the following results:

501   556   120   0 Fri02AM ??         0:00.12 /usr/local/bin/postgres -D /usr/local/var/postgres -r /usr/local/var/postgres/server.log

Does this mean that I'm running the homebrew version of postgresql?

Do I have to uninstall the system postgresql?

Answer

Ron E picture Ron E · Sep 25, 2012

Another option would be to use Heroku's Postgres.app, I personally find this a bit easier to setup and manage.

http://postgresapp.com/