Created
October 8, 2012 07:10
-
-
Save rodcisal/3851146 to your computer and use it in GitHub Desktop.
start/stop postgresql in development
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Startup/Shutdown | |
Next, as the instructions suggest you can set Postgres to start and stop automatically when your mac starts. Run these three commands to have this happen (Postgres will start when you run the last command so there is no need to manually start it if you do this): | |
mkdir -p ~/Library/LaunchAgents | |
cp /usr/local/Cellar/postgresql/9.0.4/org.postgresql.postgres.plist ~/Library/LaunchAgents/ | |
launchctl load -w ~/Library/LaunchAgents/org.postgresql.postgres.plist | |
I’ve done this because I use Postgres for all my personal projects. If you’re just experimenting and want to control when it is running you can start and stop Postgres with these commands (perhaps with a shell alias). EDIT: Someone on the Hacker News thread suggested Lunchy for managing launchctl stuff, I’ve not tried it, but it looks useful. | |
Start Postgres: | |
pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start | |
Stop Postgres: | |
pg_ctl -D /usr/local/var/postgres stop -s -m fast |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment