Server notes
Install PostgreSQL on Mac OS X
The short Homebrew route to a working PostgreSQL install on Mac OS X, including service start, database initialisation, and a role for the postgres user.
These are the steps I use to install PostgreSQL on Mac OS X.
-
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)" -
Install PostgreSQL:
brew install postgresql -
Set up automatic start:
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents -
Initialise the database cluster:
initdb -A trust /usr/local/var/postgres initdb /usr/local/var/postgres -E utf8 -
Create the postgres role:
createuser -s postgres
Start and stop manually
Start the service:
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
Stop the service:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
The first database cluster is enough for local development. For anything shared, use a proper service manager and a real password policy.