Homebrew's current version of Postgres is 10 when installed with:
brew install postgres
How do I install an older version of postgres? Specifically 9.6
Homebrew's current version of Postgres is 10 when installed with:
brew install postgres
How do I install an older version of postgres? Specifically 9.6
You can find available versions to install using brew search:
$ brew search postgresql
==> Searching local taps...
postgresql postgresql@9.4 postgresql@9.5 postgresql@9.6
To install one of these older versions, pass the full name into brew install:
$ brew install postgresql@9.6
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 postgres@9.6
cp -rf /usr/local/Cellar/postgresql@9.6/9.6.9 /usr/local/Cellar/postgresql/.
brew switch postgres 9.6.9
psqlcommands, andlibpq-fe.hlibrary available – raarts Jan 18 '18 at 14:03brew install postgresql@9.6seems to work, but if you attemptbrew info postgresqlstill points to 10.3 (current stable). Doingbrew info postgresql@9.6looks like it works, but one cannotbrew switchto it. Still not sure yet how one resolves that. – Scott Corscadden Apr 23 '18 at 20:05brew install postgres@9.6; cp -rf /usr/local/Cellar/postgresql@9.6/9.6.9 /usr/local/Cellar/postgresql/.; brew switch postgres 9.6.9– marneborn Jun 07 '18 at 22:35brew switchis the "old way" to handle versions, these days it's by leaving it there and modifying your PATH, see the instructions after installation of a particular version... – rogerdpack Aug 15 '19 at 19:39rm -rf /usr/local/var/postgres && initdb /usr/local/var/postgres -E utf8– marcelosalloum Sep 16 '20 at 17:35