I am trying to dump a Postgresql database using the pg_dump tool.
$ pg_dump books > books.out
How ever i am getting this error.
pg_dump: server version: 9.2.1; pg_dump version: 9.1.6
pg_dump: aborting because of server version mismatch
The --ignore-version
option is now deprecated and really would not be a a solution to my issue even if it had worked.
How can I upgrade pg_dump to resolve this issue?
I encountered this while using Heroku on Ubuntu, and here's how I fixed it:
Add the PostgreSQL apt repository as described at "Linux downloads (Ubuntu) ". (There are similar pages for other operating systems.)
Upgrade to the latest version (9.3 for me) with:
sudo apt-get install postgresql
Recreate the symbolic link in /usr/bin
with:
sudo ln -s /usr/lib/postgresql/9.3/bin/pg_dump /usr/bin/pg_dump --force
The version number in the /usr/lib/postgresql/...
path above should match the server version
number in the error you received. So if your error says, pg_dump: server version: 9.9
, then link to /usr/lib/postgresql/9.9/...
.