Wednesday, April 3, 2013

Installing multiple PostgreSQL versions on Homebrew

I was going to post this yesterday, but some might have thought that it was a joke. April 1st is always an annoying day to communicate real information.

If you have been fond of the way Debian and Ubuntu manage multiple PostgreSQL versions in parallel, you can now have the same on OS X with Homebrew:

brew tap petere/postgresql
brew install postgresql-9.2
# etc.
brew install --HEAD postgresql-common

postgresql-common is the same code as in Debian, only mangled a little.

Now you have all the client programs symlinked through pg_wrapper, and you can use the server management tools such as:

pg_createcluster 9.2 main
pg_ctlcluster 9.2 main start
pg_lsclusters

Let me know if you find this useful.

Links:

2 comments:

  1. I am trying to install postgresql 9.2 on OSX 10.9.3. Whenever i try "brew install postgresql-9.2", it gives "Error: No available formula for postgresql-9.2 ". If i try "brew install postgresql92", it gives me this error http://stackoverflow.com/questions/24628567/install-specific-version-of-postgresql-on-mac-using-brew

    ReplyDelete
    Replies
    1. You probably forgot the "brew tap" command.

      Delete