Skip to content

Instantly share code, notes, and snippets.

@matthewcopeland
Created November 6, 2012 18:03
Show Gist options
  • Save matthewcopeland/4026415 to your computer and use it in GitHub Desktop.
Save matthewcopeland/4026415 to your computer and use it in GitHub Desktop.
Postgres start/stop commands
# 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 -l /usr/local/var/postgres/server.log stop
# Alias them how you like, here's an example that I use.
# Copy and paste this into your .bashrc or .bash_profile (whichever you use).
alias pgsqlstart="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log start"
alias pgsqlstop="pg_ctl -D /usr/local/var/postgres -l /usr/local/var/postgres/server.log stop"
#---------------------------------------
# Now to start Postgres, just type
$ pgsqlstart
# To Stop Postgres,
$ pgsqlstop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment