Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Postgres, pg_dump version mismatch

Tags:

postgresql

What could be the cause of this? See the error below.

pg_dump: server version: 9.6.1; pg_dump version: 9.5.5
pg_dump: aborting because of server version mismatch

However, when I investigate:

peter@Peters-MacBook-Pro:~$ psql --version
psql (PostgreSQL) 9.6.1
peter@Peters-MacBook-Pro:~$ pg_dump --version
pg_dump (PostgreSQL) 9.6.1

The two versions are equal.

Additional commands:

peter@Peters-MacBook-Pro:~$ find / -name pg_dump -type f 2>/dev/null
/Applications/pgAdmin3.app/Contents/SharedSupport/pg_dump
/Applications/Postgres-9.6.1.0-2.app/Contents/Versions/9.6/bin/pg_dump
/Applications/Postgres-9.6.1.0.app/Contents/Versions/9.6/bin/pg_dump
/Applications/Postgres.app/Contents/Versions/9.6/bin/pg_dump

peter@Peters-MacBook-Pro:~$ which postgres
/Applications/Postgres.app/Contents/Versions/latest/bin/postgres

peter@Peters-MacBook-Pro:~$ which pg_dump
/Applications/Postgres.app/Contents/Versions/latest/bin/pg_dump
like image 955
Someguywhocodes Avatar asked May 26 '26 05:05

Someguywhocodes


1 Answers

To answer was to run:

/Applications/Postgres.app/Contents/Versions/latest/bin/pg_dump db_name > db.out

The path used came from by looking at the result of:

which postgres
>/Applications/Postgres.app/Contents/Versions/latest/bin/postgres

I then was able to run the correct version pg_dump

like image 140
Someguywhocodes Avatar answered Jun 04 '26 16:06

Someguywhocodes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!