First of all, you need to install brew.
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
This only needs to be done once (the first time you install postgres with brew).
initdb /usr/local/var/postgres -E utf8
Brew does not create a superuser called postgres, instead, it makes the current user a superuser. If this don’t work for you, you can run this
createuser -d -P postgres
This be the command to start the server. You can then make databases, tables and other wild code animals.
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
This stops your server. Useful when things get sluggish, no?
pg_ctl -D /usr/local/var/postgres stop -s -m fast
Get started. If you created a postgres user then use this.
sudo -U postgres psql
If you didn’t you can just use this.
psql postgres