Skip to main content

What to do When Your Package System Maintainer Fails You

·2 mins

The other day I upgraded the Homebrew package for PostgreSQL 15.5. I found my self without the expected command line programs, specifically the one I use most: psql. After a brief moment of panic of what I did wrong, I discovered from poking around the Homebrew PR that updated the package that someone decided everyone only ever used “older” versions of Postgres by updating their path instead of using the brew link option. The new right way was to use version-specific commands like psql-15 which is epically stupid.

The quickest fix I could think of was to revert to the prior package. It turns out that there is documentation how to do this, but it is scattered about. Here I summarize how I got Homebrew to reinstall the Postgres 15.5_1 package, which uses sane command names.

First, download the 15.5_1 version of the formula. The “right” way to do this is supposed to be to run brew extract --version=15.5_1 postgresql@15 $USER/taps but it complains: No available formula with the name "homebrew/core/postgresql@15".

The remaining steps are just following how to create your own tap into Homebrew then installing the package from there:

brew tap-new $USER/taps
mv ~/Downloads/postgresql@15.rb /opt/homebrew/Library/Taps/$USER/homebrew-taps/Formula
brew install $USER/taps/postgresql@15
brew link postgresql@15

There were sufficient complaints on the PR and issue I opened that this change was reverted. Still, this fix saved me for a day or two.