title: How to install Postgis to a Keg installation of Postgres@9.6 using Homebrew?
body: <p>I have installed Postgresql@9.6 and Postgis via Homebrew. However, installing Postgis via Homebrew installs the latest version of Postgresql at 10 as dependency and pinning Postgresql at 9.6.5 blocks the install of Postgis via Homebrew. </p>
  
  <p>Performing 'CREATE EXTENSION postgis;' returns:</p>
  
  <p><code>ERROR:  could not open extension control file "/usr/local/Cellar/postgresql@9.6/9.6.5/share/postgresql@9.6/extension/postgis.control": No such file or directory</code> </p>
  
  <p>I've also tried uninstalling the Postgresql (at 10) and editing the Postgis formula to depend on Postgres@9.6 instead of Postgresql. </p>
  
  <p>This is similar to <a href="https://stackoverflow.com/questions/43845177/how-to-install-postgis-to-a-keg-installation-of-postgres9-5-using-homebrew">How to install Postgis to a Keg installation of Postgres@9.5 using Homebrew?</a> but with a later keg formula</p>