install PostgreSQL in Mac OSX via Homebrew

March 10th, 2010

Apple OSX Snow Leopard
System Version: Mac OS X 10.6.2
Kernel Version: Darwin 10.2.0

Install notes for PosgreSQL 8.4 install using the great
Homebrew by Adam Vandenberg.

Run the author’s installation script, and that’s it. Try:
$ brew help
$ brew search postgresql
$ brew install postgresql
==> Summary
/usr/local/Cellar/postgresql/8.4.2: 2297 files, 31M, built in 3.3 minutes
$ brew info postgresql
postgresql 8.4.2

My advice ? Use Homebrew. True UNIX tool!

- sudo is no longer needed to install formulas system wide;
- the postgresql formula will be updated with recent postgres versions, so to check versions do: $ brew versions postgresql

(blogged from Vim)

7 Comments to “install PostgreSQL in Mac OSX via Homebrew”

  1. kevin said:

    can you give instructions for installing postgresql 9 with brew?

  2. pedro mg said:

    @kevin is there is a Brew formula for it ?

  3. Gordon Dickens said:

    I get the following error, any suggesitons?

    curl: (22) The requested URL returned error: 404
    Error: Failure while executing: curl -f#LA ‘Homebrew 0.6 (Ruby 1.8.7-174; Mac OS X 10.6.6)’ -o /Library/Caches/Homebrew/postgresql-8.4.4.tar.bz2
    Technophiliac:~ gordon$

  4. bernhard said:

    WARNING: Currently this formula installs 9.0.2, no longer 8.4.2 !!!

  5. Bruce said:

    Any idea how to get the default brew postgresql install to also build the java libs?
    Or, more generically, how to change the brew build args so that one could add whatever args are needed to build for java clients as well?

  6. Marty Y. Chang said:

    Interestingly enough, when I ran…

    $ sudo brew install postgresql

    brew came back and told me: Cowardly refusing to `sudo brew install’

    So instead I tried…

    $ brew install postgresql

    Luckily it seems like the non-sudo installation worked just fine!

  7. pedro mg said:

    Thanks @Marty, edited the post. Confirmed, current homebrew installs don’t need sudo permission to install formulas.

    @bernhard, check $ brew version postgresql

    @bruce: you’ll need to edit the formula for that, not that hard ;)

Leave a Reply