Brew does not start randomly upgrading unrelated packages.
Packages have dependencies, and those dependencies have dependencies. Try `brew deps ---tree x` to see all the dependencies for you package.
Look at `brew pin` to pin packages you don't want brew to upgrade.
Many formula are versioned. For example if you install `postgresql` it will do major upgrades of postgres as they become available, but if you install `postgres@9.6` it will only install updates to 9.6.
Packages have dependencies, and those dependencies have dependencies. Try `brew deps ---tree x` to see all the dependencies for you package.
Look at `brew pin` to pin packages you don't want brew to upgrade.
Many formula are versioned. For example if you install `postgresql` it will do major upgrades of postgres as they become available, but if you install `postgres@9.6` it will only install updates to 9.6.