Reputation: 3478
I'm trying to dump a Postgres db from Amazon RDS, which I recently updated to 10.1. To do so, I download pg_dump
10.1 from enterprisedb.com (http://get.enterprisedb.com/postgresql/postgresql-10.1-1-linux-x64-binaries.tar.gz) but when I try to use it, I get the following error:
pg_dump: server version: 10.1; pg_dump version: 10.1
pg_dump: aborting because of server version mismatch
This worked fine before, when RDS had version 9.6 and I used pg_dump
9.6 (downloaded from the same location).
I tried newer versions of pg_dump (10.2 and 10.3) but get the same error (which makes sense, because those newer versions actually don't match the RDS version).
I also checked that no other pg_dump
is installed on my server (Ubuntu 15.04 - I know I should update... waiting for 18.04), found one and deleted it, but get the same error.
What could be the problem here?
Upvotes: 2
Views: 10516
Reputation: 2503
First of all, pg_dump works perfectly with older version of the server. In such cases you will see lines like these:
-- Dumped from database version 9.6.6
-- Dumped by pg_dump version 10.1
Also, pg_dump version, say, 10.0 should work with server version 10.1 and higher in 10.* branch – so minor version should not be the issue. See this comment in pg_dump's source code: https://github.com/postgres/postgres/blob/REL_10_STABLE/src/bin/pg_dump/pg_dump.c#L668
/*
* We allow the server to be back to 8.0, and up to any minor release of
* our own major version. (See also version check in pg_dumpall.c.)
*/
In your case, the issue can be caused by one of these aspects:
Anyway, the error message you provided saying that 10.1 and 10.1 do not match – this is is not normal at all. There is a definitely a bug, but it's not obvious where.
I would try the following steps.
1) Use official (community supported) pg_dump. On Ubuntu, you need just install "postgresql-client-10" using official packages:
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ `lsb_release -cs`-pgdg main" >> /etc/apt/sources.list.d/pgdg.list'
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo apt-get update
sudo apt-get install -y postgresql-client-10
2) If the previous step doesn't help, try contacting AWS support, asking them to double-check this issue.
3) Finally, try to reproduce the problem with vanilla Postgres installed on your Ubuntu machine and if it persists, it definitely needs to be reported as a bug https://www.postgresql.org/docs/10/static/bug-reporting.html
Upvotes: 10