November 4, 2019

Error Backup Database PostgreSQL Using pg_dump

Has anyone ever done a postgres database backup using the pg_dump command line and then found problems with messages more or less like the following?

pg_dump: server version: 9.6.12; pg_dump version: 9.2.24
pg_dump: aborting because of server version mismatch

At that time I used Postgres 9.6.

If before you did not do the postgres installation process, when backing up the data and finding problems with the message more or less like what I show then do not be too quick to ambition to make postgres or other improvements because it requires a great effort especially if the problem is found in production server, DANGER 🤣 Simply find the pg_dump command line location according to the postgres version of the server being used. Usually located here /usr/pgsql-x.y/bin/pg_dump, x.y is the version of the postgres server used.

Example, because at that time I used postgres-9.6 and to continue the process of backing up the postgres database, I used the pg_dump command line located at /usr/pgsql-9.6/bin/pg_dump.