Update homebrew formulaes
➜ brew update
To install
➜ brew install postgresql
To configure with postgres superuser
➜ initdb /usr/local/var/postgres -E utf8 -U postgres
To start the service
➜ brew services start postgresql
To change the default user and database (can use any, which use most)
➜ echo "export PGUSER=postgres" >> .bash_profile
➜ echo "export PGDATABASE=postgres" >> .bash_profile
➜ source .bash_profile
To start with default value
➜ psql
To start without default value
➜ psql -U postgres -d postgres