3

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
5
  • 1
    Possible duplicate of Postgresql 9.2 pg_dump version mismatch Commented Feb 13, 2017 at 19:31
  • @vabada I have no /usr/bin/pg_dump folder which seems to be the root issue in the other thread. Commented Feb 13, 2017 at 19:46
  • Did you execute the pg_dump command that resulted in an error yourself on the commandline or was it executed by some other program like pgAdmin? pgAdmin for instance has a binary paths setting that controls which instance it runs. Commented Feb 13, 2017 at 20:09
  • 1
    IOS has a history of leaving old versions of binaries in the path. Try to use the newest version (possibly in the same /bin/ directory as your postgres DBMS server. -->> use an absolute pathname to call the binary. Commented Feb 13, 2017 at 22:18
  • @wildplasser Could you expand on this answer please? I'm not too sure how to go about "trying to newest version". Commented Feb 14, 2017 at 15:59

1 Answer 1

1

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.