When I do brew install postgresql Homebrew currently installs v10.0. I need it to install v9.6 so I did brew install [email protected] but now there are no binaries like psql, pg_dump or pg_restore. I have the possibility to mix it up with v10.0 by just installing both versions and then just run the server in v9.6 and the binaries would be on v10.0. But I want to have everything on v9.6 for now. How can I achieve this?
brew install postgresql and legacy brew install [email protected]/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/ you should have formulas files for both versions of postgresql, [email protected] and postgresql.rb.url and sha256 values from [email protected] and overwrite with them corresponding ones in file postgresql.rb/usr/local/var/postgres (just to clear all the leftovers from previous installations)brew install postgresql. Version 9.6 should be recognised from the edited formula file postgresql.rm and installed as latest. brew pin postgresql.With this procedure you have postgresql 9.6 installed with working CLI commands

Versioned formulas are generally keg-only, which effectively means they are not symlinked into /usr/local. So you have them, just not automatically accessible. Homebrew should tell you that much in post-installation caveats memo (including additional manual setup options). Depending on your specific situation one of the following should work:
PATH variable manually, e.g. export PATH="/usr/local/opt/[email protected]/bin:$PATH"brew link [email protected] --forcebrew switch if you have/need multiple versions installedHope it helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With