Obromios
Obromios

Reputation: 16413

How to stop homebrew automatically upgrading postgresql

The brew upgrade command upgrades all packages, so if postgresql is installed with homebrew, the package can be upgraded to a new version incompatible with your databases. How do I prevent this from happening?

Upvotes: 4

Views: 542

Answers (2)

Jamie Orchard-Hays
Jamie Orchard-Hays

Reputation: 99

Unfortunately, brew install <some-app> also upgrades MySQL and Postgres. I just invoked brew install awsebcli and brew proceeded to upgrade two versions of Postgres and one of MySQL, none of which I wanted. This is not expected and not desirable behavior.

Upvotes: 0

Obromios
Obromios

Reputation: 16413

Homebrew can be used to pin a package to its existing version, so if you are using version 12, you can pin it using

brew pin postgresql@12

You need to do this for each major version you are using. If later on, you wish to upgrade then you can do

brew unpin postgresql@12

Upvotes: 6

Related Questions