0

I use pip3 install pgadmin4==4.30 to install pgadmin in my ubuntu. And I want to backup my remote server data by Tools-Backup in pgadmin, which is equal to the following command.

/usr/bin/pg_dump --file "~/demo.backup" --host "127.0.0.1" --port "42885" --username "postgres"....

However there is an error says:pg_dump: sever version:11.7; pg_dump version: 10.3(Ubuntu-10.3-1). One thing that puzzles me is I don't have version 11.7 installed at all. Here is the output of ls -la /usr/bin/pg_dump

0 lrwxrwxrwx 1 root root 34 Mar 2 18:05 /usr/bin/pg_dump -> /usr/lib/postgresql/10/bin/pg_dump

And there is only one version(10) in /usr/lib/postgresql folder. Anyone can tell me how I can fix this? I have tried every solution of this and neither of them worked out.

haojie
  • 593
  • 1
  • 7
  • 19
  • You do have PostgreSQL 10.3 installed on the machine where you run pgAdmin, and pgAdmin uses the `pg_dump` executable from that installation. Upgrade the PostgreSQL client. – Laurenz Albe Mar 04 '22 at 09:04
  • It is the remote server that has 11.7 installed. – jjanes Mar 04 '22 at 16:44
  • Are it actually using `pgAdmin` to do this or are you running it from the command line? How are you dumping a remote server using `--host "127.0.0.1"`? Is there forwarding going on? Add answers as update to question. – Adrian Klaver Mar 04 '22 at 16:55
  • @AdrianKlaver I use it in `pgadmin`, the command is `pgadmin` shows. – haojie Mar 05 '22 at 12:32
  • You have not answered all the questions, nor have you done as requested and updated your question with the latest information. So you are using the Tools --> Backup in `pgAdmin`, correct? Update you question with the information. – Adrian Klaver Mar 05 '22 at 16:43
  • @AdrianKlaver Yeah, that is quite right. I use Tools --> Backup in `pgadmin`. I have edited my question. – haojie Mar 06 '22 at 08:56
  • 1
    You still have not answered how you are dumping a remote server via `127.0.0.1`? Or where the remote server is and what Postgres version it is? – Adrian Klaver Mar 06 '22 at 16:50
  • @AdrianKlaver Thanks Adrian Klaver, I think that is the point. I have tested a remote server which is not `127.0.0.1` which works well. – haojie Mar 07 '22 at 06:06
  • Bottom line is what ever Postgres server you are trying to dump from is version 11.7 and the `pg_dump` is coming from a Postgres 10.3 install. As the error states that will not work. `pg_dump` is backwards compatible, but can not dump from newer version then it's own. Until you provide a consistent and complete explanation of what you are doing this is as much as I can offer. – Adrian Klaver Mar 07 '22 at 15:40

0 Answers0