To prevent Homebrew packages from being accidentally upgraded use `brew pin $FORMULA` and `brew unpin $FORMULA` respectively. This fixes a long standing issue that I've had with Postgres databases being accidentally upgraded.