postgres

Installing postgres on OSX Lion with homebrew

1) Update homebrew and install it:

brew update
brew install postgresql

2) Create the postgres database

initdb /usr/local/var/postgres

3) Setup postgres to run on boot

cp /usr/local/Cellar/postgresql/9.1.3/homebrew.mxcl.postgresql.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist

That's it. You can now use createuser and createdb to setup your database.