Can't get pg_dump To Work Now That Heroku Has Upgraded Postgresql to 9.4?
Apr 29, 2015 18:17

I'm in the middle of a big upgrade to my new Software as a Service company - upgrading it from being just for gourmet fresh-grind coffee machines to supporting any kind of vending machine. This change has required a lot of refactoring and updating of the database. To make sure this is all working properly, I set up a staging server on Heroku last night. This lets me test out the migrations and data update scripts without impacting the live system.

This has been working great until I tried copying the staging database back down to my local machine to test some fixes. I got this message:

pg_dump: server version: 9.4.1; pg_dump version: 9.3.1 pg_dump: aborting because of server version mismatch

I'm using Heroku's handy Postgres.app and I discovered that there was indeed a new version out, supporting Postgresql 9.4. So I downloaded and fired it up. It uses an entirely new data directory and didn't migrate over my local databases, which would have been more annoying except my local DBs are just for development.

I was still getting the "server version mismatch" error, though. Turns out the new Postgres.app doesn't update my $PATH to where its utilities live - and it turns out that this is different from where it was set in the previous version.

You need to update your .bashrc (or whatever) file to include this:

PATH=/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH:

Then restart your terminal and you can get back to your regular work.

Previous:
The Best Thing I Ever Did To Promote My App
Jan 15, 2015 20:08
Next:
What's Up With Remembary
Jul 27, 2015 11:22