Start Postgresql:
sudo -u postgres /Library/Postgresql/9.6/bin/pg_ctl -D /Library/Postgresql/9.6/data start
Stop Postgresql:
sudo -u postgres /Library/Postgresql/9.6/bin/pg_ctl -D /Library/Postgresql/9.6/data stop
Stop Postgresql from auto-starting on reboot:
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.6.plist
Make Postgresql auto-start on reboot:
sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.6.plist
Mac启动时,不自动启动postgresql,也可以作为停止postgresql的命令:
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.6.plist
自动启动postgresql,也可以作为启动postgresql的命令:
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.6.plist
原文链接:https://www.f2er.com/postgresql/194335.html