B
B
BonBon Slick2018-09-27 11:56:02
PostgreSQL
BonBon Slick, 2018-09-27 11:56:02

pg_dump: aborting because of server version mismatch?

pg_dump: server version: 10.5 (Debian 10.5-1.pgdg90+1); pg_dump version: 9.6.10
pg_dump: aborting because of server version mismatch

DBREAVER trying to make a backup
[email protected]:/var/www/qwe/asd$ sudo apt-get install postgresql-9.6
[sudo] password for bonbon: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
postgresql-9.6 is already the newest version (9.6.10-0+deb9u1).
postgresql-9.6 set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.
[email protected]:/var/www/qwe/asd$ sudo apt-get install postgresql-10
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package postgresql-10
[email protected]:/var/www/qwe/asd$ sudo apt-get install postgresql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
postgresql is already the newest version (9.6+181+deb9u2).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.

Process exit code: 1
/usr/bin/pg_dump --cluster 9.6/main --format=p --compress=4 --encoding=UTF-8 -n public --verbose --host=oppasland.vagrant --port=5432 ****** ******
Backup started at Thu Sep 27 12:00:32 EEST 2018
pg_dump: server version: 10.5 (Debian 10.5-1.pgdg90+1); pg_dump version: 9.6.10
pg_dump: aborting because of server version mismatch
Backup finished at Thu Sep 27 12:00:32 EEST 2018
Process exit code: 1
/usr/bin/pg_dump --cluster 10.5/main --format=p --compress=4 --encoding=UTF-8 -n public --verbose --host=oppasland.vagrant --port=5432 ****** ******
Backup started at Thu Sep 27 12:00:48 EEST 2018
Error: Invalid version specified with --cluster
Backup finished at Thu Sep 27 12:00:48 EEST 2018
Process exit code: 1

[email protected]:/usr/bin$ find / -name pg_dump -type f 2>/dev/null
/usr/lib/postgresql/9.6/bin/pg_dump

[email protected]:/usr/bin$ sudo apt-get install postgresql
Reading package lists... Done
Building dependency tree       
Reading state information... Done
postgresql is already the newest version (9.6+181+deb9u2).
0 upgraded, 0 newly installed, 0 to remove and 10 not upgraded.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Dmitry Telepnev, 2018-09-27
@BonBonSlick

You have a utility that is included with postgresql-client - pg_dump, the version is lower than the version of the database server. You need to update the postgresql-client package.

M
Melkij, 2018-09-27
@melkij

pg_dump intentionally refuses to work with major version servers higher than its own.
You explicitly specify the host --host=oppasland.vagrant - i.e. obviously a different OS and therefore it is completely logical that your local repositories may not have updated the package to the required major version. Many distributions freeze major versions of packages. Just as formally and with a justified purpose.
You can use the official PostgreSQL Global Development Group repository , here updates to the base packages are released along with the postgresql releases themselves.
Or do a dump directly from the machine where the database is running. There locally pg_dump costs the correct version.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question