How do you install an older version of Postgres (9.6) using homebrew?

You can find available versions to install using brew search:

$ brew search postgresql
==> Searching local taps...
postgresql        [email protected]        [email protected]        [email protected]

To install one of these older versions, pass the full name into brew install:

$ brew install [email protected]

It will give you instructions on how to add that PATH of that particular version to your bash environment, so you can use its psql etc.

If you still have psql booting up a newer version of postgresql, try this:

brew install [email protected]
cp -rf /usr/local/Cellar/[email protected]/9.6.9 /usr/local/Cellar/postgresql/.
brew switch postgres 9.6.9