Pre-Reqs
brew doctor
brew update
Installing
brew install postgres
ln -sfv /usr/local/opt/postgresql/*.plist ~/Library/LaunchAgents
Create aliases:
alias pg_start="launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist"
-
alias pg_stop="launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist"
This alias is only set for that terminal window, so to set this permanently, find your shell path by:
-
echo $SHELL
Then you can append the alias to the computer shell file. For me, this was ~/.zshrc
Note: Make sure to echo the alias and use “>>” to append, not “>” which completely wipes the file with the text. This is what I did, and unfortunately, all the past things I added to my shell file were erased and it could not be undone.
Leave a Reply