
This last step allows you to use tools like pg_dump etc. Make PostgreSQL related tools usable with the terminal psqlrc.local.ĭownload the release having the desired version.ģ. Then delete the related files rm -rf /usr/local/var postgres. Remove all PostgreSQL version installedĬheck running version brew services list then stop them brew services stop postgresql.ĭelete all installed formulas with brew uninstall postgresql and brew uninstall per installed version.

If you already have PostgreSQL installed on your system via Homebrew but want to use a specific version (like a previous one) with Postgres.app, just follow these steps:ġ. My current solution is to use the Postgres.app. It allows to easily switch to another installed version of a formula by running brew switch As you guess I tried, but the problem is that Homebrew only handles major versions of each release and I need a specific minor version.īecause I also need to switch between old and recent Rails projects, I often have to change the running PostgreSQL version. Like most dev running on macOS, I usually use Homebrew. At the time of writing this article, the latest version of PostgreSQL available from the default Debian repositories is PostgreSQL version 11.5. It results in conflicts with the db/structure file each time I run a db:migrate. The problem is that my machine uses a later version.

The PostgreSQL version of the project I'm working on at work is 9.6.6. To determine the version of the database client, use psql -version (from your shell command line): psql -version psql (PostgreSQL) 9.6.2. Enter fullscreen mode Exit fullscreen mode
