Install Postgresql on Mac OS X

Here is the steps how you can install postgresql on Mac OS X:

  1. install homebrew ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

  2. install postgresql brew install postgresql

  3. set automatic start ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents

  4. initialize database cluster initdb -A trust /usr/local/var/postgres initdb /usr/local/var/postgres -E utf8

  5. create postgres role createuser -s postgres

Start and stop manually

start: launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

stop: launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

Jozsef

Read more posts by this author.