如何修复pg_dump版本不匹配错误? [英] How to fix pg_dump version mismatch errors?

查看:862
本文介绍了如何修复pg_dump版本不匹配错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当试图获取本地数据到Heroku时,我遇到了两个不同版本的pg_dump之间的版本不匹配。

When trying to get local data to Heroku, I am encountering a version mismatch between two different versions of pg_dump.

具体来说,我收到此消息:

Specifically, I am getting this message:

pg_dump: server version: 9.2.2; pg_dump version: 9.1.4
pg_dump: aborting because of server version mismatch

其他有此问题的人,但对实施建议的解决方案了解不足。 (我是Ruby on Rails,PostgreSQL,Heroku和Mac的新手!在我玩游戏的同时,还处于起步阶段。)

I have found others with this problem, but do not know enough to implement the proposed solutions. (I am new to Ruby on Rails, PostgreSQL, Heroku, and the Mac! Very much at the stage of playing around the picking things up as I go.)

I我当时想,如果我卸载本地计算机上的所有PostgreSQL,然后从 http:// postgresapp重新安装PostgreSQL 9.2.2,就可以简化我的生活。 com / ,但我不知道如何进行卸载。

I was thinking I might simplify my life if I uninstalled all PostgreSQL on my local machine and started again with a clean install of PostgreSQL 9.2.2 from http://postgresapp.com/, but I don't know how to go about doing the uninstall.

我正在运行Mac OS X Mountain Lion 10.8.2。

I'm running Mac OS X Mountain Lion 10.8.2.

推荐答案

OS X 10.8随附 / usr / bin 目录中的 pg_dump 版本9.1.4,以及 psql 和其他作为客户端 PostgreSQL工具的程序。这并不意味着已安装PostgreSQL作为服务器(除非您具有OS X Server Edition)。
所以您不必卸载PostgreSQL,因为它尚未安装,最好不要在 / usr / bin 中删除​​这些postgres客户端工具。苹果公司提供的系统。

OS X 10.8 comes with pg_dump version 9.1.4 in the /usr/bin directory, along with psql and other programs that are client-side PostgreSQL tools. It does not mean that PostgreSQL as a server is installed (unless you have OS X Server Edition). So you don't have to uninstall PostgreSQL because it's not installed and it's better not to remove these postgres client tools in /usr/bin because they belong to the system as shipped by Apple. They just need to be side-stepped.

postgres.app提供的软件包包括PostgreSQL服务器和与此服务器相同版本的客户端工具。这些工具安装在 /Applications/Postgres.app/Contents/MacOS/bin

The package provided by postgres.app comprises both the PostgreSQL server and the client-side tools of the same version as this server. These tools get installed in /Applications/Postgres.app/Contents/MacOS/bin

在终端中工作时来自Apple的9.1版本,postgres.app 文档说:

To use these instead of the 9.1 ones from Apple when you work in a Terminal, postgres.app documentation says to do:

PATH="/Applications/Postgres.app/Contents/MacOS/bin:$PATH"

并将其放在您的 .profile 文件中。

and put it in your .profile file.

完成此操作并运行 pg_dump 后,您不应再收到错误消息,因为它是错误的版本,因为它将是postgres附带的版本.app(当前为9.2.2)。

Once you have done that and you run pg_dump, you should no longer get the error that's it's the wrong version, because it would be the one that ships with postgres.app (currently 9.2.2).

我有此设置,对我来说很好。

I have this setup and it works OK for me.

这篇关于如何修复pg_dump版本不匹配错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆