Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pg_dump version mismatch in Rails

When running the rake db:structure:dump command, I encountered the following error:

Larson-2:app larson$ rake db:structure:dump
pg_dump: server version: 9.1.3; pg_dump version: 9.0.4
pg_dump: aborting because of server version mismatch
rake aborted!
Error dumping database

How can I go about updating pg_dump? I have pg 9.1.3 installed, is there a way to update the references inside of Rails to the new version?

When I try to update postgres via homebrew, I get the following output:

Larson-2:app larson$ sudo brew upgrade postgresql
Password:
Error: postgresql already upgraded
like image 323
Andrew Lauer Barinov Avatar asked Mar 21 '12 06:03

Andrew Lauer Barinov


People also ask

What is Pg_dump version?

pg_dump is a utility for backing up a PostgreSQL database. It makes consistent backups even if the database is being used concurrently. pg_dump does not block other users accessing the database (readers or writers). pg_dump only dumps a single database.


1 Answers

Here's how I resolved the issue, first update homebrew:

brew update
if you get this error: error: Your local changes to the following files would be overwritten by merge:

then:

cd /usr/local/cellar
git reset --hard FETCH_HEAD

After you finish updating homebrew:
sudo brew install postgresql
Which will install 9.1.3 (or the most current version of pg) and any dependencies.

like image 102
Andrew Lauer Barinov Avatar answered Sep 30 '22 14:09

Andrew Lauer Barinov