brew install postgres on psql code example
Example 1: homebrew postgres
brew install postgresql
Example 2: run postgres locally
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start
brew install postgresql
$ pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start