Monday, November 25, 2013

Start/Stop PostgreSQL on Mac

Start PostgreSQL:-
sudo -u postgres /Library/PostgreSQL/9.3/bin/pg_ctl -D /Library/PostgreSQL/9.3/data start
Stop PostgreSQL:-
sudo -u postgres /Library/PostgreSQL/9.3/bin/pg_ctl -D /Library/PostgreSQL/9.3/data stop
Stop PostgreSQL from auto-starting on reboot:-
sudo launchctl unload -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist 
Make PostgreSQL auto-start on reboot:-
sudo launchctl load -w /Library/LaunchDaemons/com.edb.launchd.postgresql-9.3.plist 
Refs
http://www.xtuple.org/faq/xtuple-faq/postgresql/how-do-i-stop-postgresql-service-mac 
https://gist.github.com/abhishekdev/1960888