Homebrew is a great tool on Mac to install 3rd-party softwares and unix softwares like
Redis, etc. Today let’s install
PostgreSQL 9.4 with it.
First, install it with
bash brew install homebrew/versions/postgresql94
And then, start
postgresqlservice with following command:
brew services start homebrew/versions/postgresql94
This command will make sure
postgresqlis running every time you restart your computer. If you just want to start it one time, you could try command:
postgres -D /usr/local/var/postgres
Last thing you need to do is to create a superuser
createuser -d -a -s -P postgres
After entering your password, you have a running postgresql now.