Forums

Postgres pg_dump

I'm trying to backup data from a Postgres database using:

pg_dump --host=ADDRESS_FROM_DB_TAB --port=PORT_FROM_DB_TAB --username=super --format=c --file=pgbackupdate +%F-%H%M.dump DB_NAME

It then asks me for my password, I enter the super password, it then says:

pg_dump: server version: 12.2 (Ubuntu 12.2-2.pgdg16.04+1); pg_dump version: 9.4.25 pg_dump: aborting because of server version mismatch

I tried updating pg_dump using apt-get but I don't have the permission for that.

How can I backup my Postgres database? Ideally I want to setup a script to backup every day

hi there, thanks for reporting! we just upgraded our postgres server version, and there's a possibility we did not upgrade pg_dump to the corresponding version. we will get back to you ASAP about any potential solutions.

another thing that you could try is to build your own pg_dump in your home directory and use that.

We have a workaround that you can implement until we have a more permanent fix. Drop us a line using the feedback link and we'll send you the details.

Great, thanks!

We've updated the "Databases" page so that it displays the command to run to upgrade your pg_dump and other related tools if you're using Postgres 12, and if the tools have not already been upgraded.

Brilliant, I have upgraded it! It works! Thank you for the quick fix!

Hi, I am experiencing the same issue.

I have run the command on the 'Database' page. However, it still says that there is server version mismatch when I run the pg_dump command

Were there any errors when you ran the command from the "Databases" page?

Hi, no there were no errors. Everything ran fine

Can we take a look at your files? We can see them from our admin interface, but we always ask for permission first.

Please do, Thank you

That's very strange, you don't seem to have the installation of the Postgres stuff that the script on the "Databases" page should have created. Could you try running that command again, and post what it prints out here?

This what was sent to me when i ran the command on the bash terminal. I realized that there was a 404 error when trying to run the command.

Downloading new Postgres client tools... --2020-08-23 06:24:52-- https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-12/postgresql-client-12_12.3-1.pgdg90%2B1_amd64.deb Resolving apt.postgresql.org (apt.postgresql.org)... 217.196.149.55, 87.238.57.227, 72.32.157.246, ... Connecting to apt.postgresql.org (apt.postgresql.org)|217.196.149.55|:443... connected. HTTP request sent, awaiting response... 404 Not Found 2020-08-23 06:24:52 ERROR 404: Not Found.

Installing (this may take a couple of minutes)... dpkg-deb: error: failed to read archive 'postgresql-client-12_12.3-1.pgdg90+1_amd64.deb': No such file or directory Configuring... All done! Start a new console to use the new Postgres tools.

Thanks for letting us know! It looks like there were two problems:

  • The script printed out "All done!" even if it failed, which was misleading.
  • The version of the Postgres client tools that we were using has been removed.

I've fixed both errors, and tested it in my own account; it should work fine now.

Thank you for your help!!!

No problem! From our admin interface, it doesn't look like you've had a chance to run it yet, but do let us know if you have any problems when you do.

That's interesting as I had already run the command and it said that it was all done and that I can start to use it.

That is interesting! The admin interface is now showing the packages as installed, though, so I agree that you should be able to use it without problems.