Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to update pg_dump to server version in Mac OS

I'm trying to backup a local database in my laptop (PostGresSQL 9.6 ,PgAdmin3) and I see the following error.

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

I've tried some answers on SO, like updating the postgres on homebrew but it threw an error as well.

Error: postgres not installed

When I checked the contents of postgres application package, I found 2 folders in the versions folder, 9.5 and 9.6. I tried running the pg_dump in the bin folder of both the versions and all I see is this error:

enter image description here

Can someone help me to solve this problem and make a backup of my database

like image 793
ASN Avatar asked Jul 11 '17 04:07

ASN


People also ask

Where is pg_dump file stored?

sql , which uses the plain or SQL format, the pg_dump command does not store any file anywhere. It just sends the output to STDOUT , which is usually your screen, and it's done.

Is pg_dump backwards compatible?

restores to earlier versions not working.

What does the pg_dump command do?

pg_dump can be used to backup an entire database, then pg_restore can be used to examine the archive and/or select which parts of the database are to be restored. The most flexible output file formats are the “custom” format ( -Fc ) and the “directory” format ( -Fd ).


1 Answers

If using brew on MacOS brew install [email protected] Homebrew install specific version of formula?

Stop postgres

brew services stop postgresql

Upgrade with Homebrew

brew update
brew upgrade postgresql

Check Version:

psql --version
> psql (PostgreSQL) 10.3
like image 188
Lex Avatar answered Oct 22 '22 04:10

Lex