14

I'm trying to backup a local database in my laptop (PostGresSQL 9.6 ,PgAdmin3) and I see the following error.

pg_dump: server version: 9.6.3; pg_dump version: 9.5.5 pg_dump: aborting because of server version mismatch

I've tried some answers on SO, like updating the postgres on homebrew but it threw an error as well.

Error: postgres not installed

When I checked the contents of postgres application package, I found 2 folders in the versions folder, 9.5 and 9.6. I tried running the pg_dump in the bin folder of both the versions and all I see is this error:

enter image description here

Can someone help me to solve this problem and make a backup of my database

ASN
  • 1,655
  • 4
  • 24
  • 52

3 Answers3

4

Resurfaced when our server got to postgresql 13.8 and locally I was on 12

Uninstall the old postgresql version and install a new one. Start & stop postgres services too. On Mac:

brew install postgresql@13 # install server version or higher
brew services stop postgresql@12 # stop postgres
brew uninstall postgresql@12 # uninstall old version
brew services start postgresql@13 # start newly installed version

Double check the version in use: psql --version

Get info on postgresql versions installed via brew: brew info postgresql@13

Jeff Spicoli
  • 280
  • 5
  • 13
1

If using brew on MacOS brew install postgresql@8.4.4 Homebrew install specific version of formula?

Stop postgres

brew services stop postgresql

Upgrade with Homebrew

brew update
brew upgrade postgresql

Check Version:

psql --version
> psql (PostgreSQL) 10.3
Lex
  • 4,749
  • 3
  • 45
  • 66
-1

I found this one more helpful than above. It has upgraded the DB without any issue. https://quaran.to/Upgrade-PostgreSQL-from-12-to-13-with-Homebrew

brew services stop postgresql
brew postgresql-upgrade-database
brew services start postgresql
Ahmad Hussain
  • 2,443
  • 20
  • 27