Up till now, I was using Brew to install and update Postgres. All was fine until I installed the latest version of Postgres which at the time of this writing was 10.0.

The latest Rails (5.1.4) was working fine with it, but older apps (5.0.2) were failing with cryptic error:

ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "increment_by" does not exist
LINE 1: ...sses_id_seq"', (SELECT COALESCE(MAX("id")+(SELECT increment_...

I didn’t dive deep into it, but something has changed between Rails 5.0.2 and 5.1.4. There were even multiple tickets opened for this on Rails repo (google it if you need it).

I needed a quick way to have two version of Postgres available (10.0 and 9.6.5). Mucking around with symlinks and trying to figure out how to make Brew work with it all wasn’t on my agenda.

That’s when I remembered about Postgres app for Mac which conveniently allows having multiple versions. Just start the right one when you need it. Fast and simple! 👌