Homebrew / brew

🍺 The missing package manager for macOS (or Linux)
https://brew.sh
BSD 2-Clause "Simplified" License
41.33k stars 9.72k forks source link

There should be a mechanism stopping inadvertent major-version upgrades #4726

Closed ellmo closed 6 years ago

ellmo commented 6 years ago

When performing brew upgrade or brew upgrade <formula>, the default behaviour should not allow for major version upgrades – at least not for complicated software like PostrgreSQL.

The reason behind this is that those upgrades often stop software from working as intended, as many major-version updates are not fully backwards compatible – and in the case of PostgreSQL they are actually worlds apart.

5 minute googling session showed that I was by far not the only one who managed to unwillingly jump from PosgtreSQL 9.6 to 10.5 in a mere console command – and, while I do admit, that I erroneously used brew upgrade instead of brew update – there was no way to simply reverse what I did when I realised my mistake.


On a side note: I managed to broke my databases completely when I decided to just go with it and use brew postgresql-upgrade-database which failed and now my local databases for both 9.6 and 10.5 are completely empty.

If anyone knows wether brew postgresql-upgrade-database creates a backup of databases before attempting to update and where to find it – I'd be much obliged

MikeMcQuaid commented 6 years ago

Do not run brew upgrade without arguments if you wish to avoid this behaviour. Also, I recommend using Time Machine or similar so you can recover from similar incidents. Finally, please always fill out the issue template (as it told you to do).