I was getting an error of "pg_dump: server version: 9.4.7; pg_dump version: 9.3.9 ubuntu" while taking backup from server to my machine. I rectified the error using the following steps
- Check the version of psql and pg_dump
- pg_dump --version
- psql --version
- Install postgresql version 9.4
- cd /etc/apt/sources.list.d/
- sudo vi pgdg.list
- Add the following line
- deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main
- wget --quiet -O - \ https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
- sudo apt-get install postgresql-9.4
- sudo apt-get install pgadmin3
- sudo /etc/init.d/postgresql restart
- sudo rm /usr/bin/pg_dump
- sudo ln -s /usr/lib/postgresql/9.4/bin/pg_dump /usr/bin/pg_dump
References
1-http://stackoverflow.com/questions/23793774/psql-and-pg-dump-version-mismatch