Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

psql and pg_dump version mismatch

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?

like image 902
Pablo Fernandez Avatar asked May 21 '14 21:05

Pablo Fernandez


People also ask

What is PSQL pg_dump?

Description. pg_dump is a utility for backing up a PostgreSQL database. It makes consistent backups even if the database is being used concurrently. pg_dump does not block other users accessing the database (readers or writers). pg_dump only dumps a single database.

Is PostgreSQL backwards compatible?

We always recommend that all users run the latest available minor release for whatever major version is in use. Major versions usually change the internal format of system tables and data files. These changes are often complex, so we do not maintain backward compatibility of all stored data.

What is the difference between pg_dump and Pg_dumpall?

One caveat: pg_dump does not dump roles or other database objects including tablespaces, only a single database. To take backups on your entire PostgreSQL cluster, pg_dumpall is the better choice. pg_dumpall can handle the entire cluster, backing up information on roles, tablespaces, users, permissions, etc…


1 Answers

sudo rm /usr/bin/pg_dump
sudo ln -s /usr/lib/postgresql/9.3/bin/pg_dump /usr/bin/pg_dump
like image 196
Henry Avatar answered Sep 28 '22 01:09

Henry