psql and pg_dump version mismatch

Pablo Fernandez picture Pablo Fernandez · May 21, 2014 · Viewed 13.1k times · Source
omnia@ubuntu:~$ psql --version
psql (PostgreSQL) 9.3.4
omnia@ubuntu:~$ pg_dump --version
pg_dump (PostgreSQL) 9.2.8
omnia@ubuntu:~$ dpkg -l | grep pg
ii  gnupg                            1.4.11-3ubuntu2.5                 GNU privacy guard - a free PGP replacement
ii  gpgv                             1.4.11-3ubuntu2.5                 GNU privacy guard - signature verification tool
ii  libgpg-error0                    1.10-2ubuntu1                     library for common error values and messages in GnuPG components
ii  libpq5                           9.3.4-1.pgdg60+1                  PostgreSQL C client library
ii  pgdg-keyring                     2013.2                            keyring for apt.postgresql.org
ii  postgresql-9.2                   9.2.8-1.pgdg60+1                  object-relational SQL database, version 9.2 server
ii  postgresql-9.3                   9.3.4-1.pgdg60+1                  object-relational SQL database, version 9.3 server
ii  postgresql-client-9.2            9.2.8-1.pgdg60+1                  front-end programs for PostgreSQL 9.2
ii  postgresql-client-9.3            9.3.4-1.pgdg60+1                  front-end programs for PostgreSQL 9.3
ii  postgresql-client-common         154.pgdg60+1                      manager for multiple PostgreSQL client versions
ii  postgresql-common                154.pgdg60+1                      PostgreSQL database-cluster manager
ii  python-gnupginterface            0.3.2-9.1ubuntu3                  Python interface to GnuPG (GPG)
ii  unattended-upgrades              0.76ubuntu1                       automatic installation of security upgrades
ii  update-manager-core              1:0.156.14.13                     manage release upgrades
omnia@ubuntu:~$ 

Seems I have both installed but pg_dump is stuck in an older version? Weird since both are linked to the same "wrapper":

omnia@ubuntu:~$ readlink /usr/bin/psql
../share/postgresql-common/pg_wrapper
omnia@ubuntu:~$ readlink /usr/bin/pg_dump
../share/postgresql-common/pg_wrapper

What am I doing wrong?

Answer

Henry picture Henry · Dec 4, 2014
sudo rm /usr/bin/pg_dump
sudo ln -s /usr/lib/postgresql/9.3/bin/pg_dump /usr/bin/pg_dump