Command pg_dump not found?

124,825

Solution 1

For 14.04 you can just install postgresql-client (as it depends on postgresql-client-common):

sudo apt-get install postgresql-client

To quickly know which package contains a command/binary missing on your system, just use package.ubuntu.com (Search the contents of packages).

Solution 2

For those of you who get the same issue with PostgreSQL 10, you don't need to install additional packages; pg_dump is already there in postgres's bin directory. So you just need to append that bin path (e.g. /opt/PostgreSQL/10/bin) manually to the PATH environment variable.

Share:
124,825

Related videos on Youtube

forvas
Author by

forvas

Currently working with Python, XML, Bootstrap, Odoo framework, PostgreSQL and more. I am a developer who likes learning and helping.

Updated on September 18, 2022

Comments

  • forvas
    forvas almost 2 years

    I was trying to make a backup in a server and I got the error:

    pg_dump command not found
    

    I thought that if you had postgres installed, it worked. What I have to do to install this command? I do not think that it is possible with apt-get or aptitude.

    • Jos
      Jos almost 10 years
      I believe pg_dump is part of the package postgresql-client-x.x, as well as a couple of other housekeeping utilities. Make sure you replace x.x by the proper version number for your server.
    • geethujoseph
      geethujoseph almost 10 years
      You need to install postgresql-client-common if you want it to be in the path. Either way it should be available in /usr/lib/postgresql/YOUR_PG_VERSION/bin/pg_dump (14.04)
    • Sylvain Pineau
      Sylvain Pineau almost 10 years
      Use package.ubuntu.com to find which package contains a given command/binary:
    • Craig Ringer
      Craig Ringer almost 10 years
      You've copied this from superuser.com/q/786363/167160. Please don't clone questions between sites, especially without linking between them. It wastes everyone's time.
  • Andrew
    Andrew almost 6 years
    this also solves pg_restore not found error
  • douglaslps
    douglaslps over 5 years
    You may need to add the postgresql repository as indicated here: askubuntu.com/a/633923/259828
  • VasyaNovikov
    VasyaNovikov almost 5 years
    On ArchLinux: pacman -S postgresql