postgres.plugin.zsh
480 bytes
1# Aliases to control Postgres
2# Paths noted below are for Postgres installed via Homebrew on OSX
3if (( ! $+commands[brew] )); then
4 return
5fi
6
7local PG_BREW_DIR=$(brew --prefix)/var/postgres
8
9alias startpost="pg_ctl -D $PG_BREW_DIR -l $PG_BREW_DIR/server.log start"
10alias stoppost="pg_ctl -D $PG_BREW_DIR stop -s -m fast"
11alias restartpost="stoppost && sleep 1 && startpost"
12alias reloadpost="pg_ctl reload -D $PG_BREW_DIR -s"
13alias statuspost="pg_ctl status -D $PG_BREW_DIR -s"