Install PostgreSQL on Mac via brew

0xkoji - May 30 '19 - - Dev Community

install

This case is installing 9.6. If you remove @9.6, you will get the latest version of PostgreSQL.

$ brew reinstall postgresql@9.6
$ echo 'export PATH="/usr/local/opt/postgresql@9.6/bin:$PATH"' >> ~/.zshrc
or 
$ echo 'export PATH="/usr/local/opt/postgresql@9.6/bin:$PATH"' >> ~/.bashrc
Enter fullscreen mode Exit fullscreen mode

start & stop

$ brew services start postgresql
$ brew services stop postgresql
$ brew services list
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .