简体   繁体   English

我的OSX Lion上有2个版本的pg_dump

[英]2 versions of pg_dump on my OSX Lion

I had Postgres 9.0.x installed with homebrew, but because of lack of some modules I removed it using: 我使用自制软件安装了Postgres 9.0.x,但由于缺少某些模块,我使用以下方法将其删除:

brew uninstall postgres

and installed Postgres 9.1.3 from http://www.enterprisedb.com/downloads/postgres-postgresql-downloads . 并从http://www.enterprisedb.com/downloads/postgres-postgresql-downloads安装了Postgres 9.1.3。

Now I've got a problem - 2 different versions on pg_dump - 9.0.5 and 9.1.3 and 9.0.5 is the default version. 现在我遇到了一个问题 - 在pg_dump上有两个不同的版本 - 9.0.5和9.1.3和9.0.5是默认版本。

Is there any way to set the 9.1.3 version as the default version of pg_dump? 有没有办法将9.1.3版本设置为pg_dump的默认版本?

So based on your additional comments, your new version of pg_dump is not in your PATH, all you need to do is to remove the old version, and symlink the new one to any directory in your PATH, for example, /usr/bin . 因此,根据您的附加注释,您的新版本的pg_dump不在您的PATH中,您只需删除旧版本,并将新版本符号链接到PATH中的任何目录,例如/ usr / bin

Like follows: 如下:

sudo ln -s /actual/new/pg_dump /usr/bin/pg_dump

Hope this helps 希望这可以帮助

Valentin has the right answer, but of course, the question for Mac users is where the heck is pg_dump? Valentin有正确的答案,但当然,Mac用户的问题是pg_dump到底是什么?

If you have version 9.2, it's: /Library/PostgreSQL/9.2/bin/pg_dump 如果您的版本为9.2,则为:/Library/PostgreSQL/9.2/bin/pg_dump

Just copy this to /usr/bin 只需将其复制到/ usr / bin即可

I was having the same error essentially. 我本质上有同样的错误。

pg_dump: server version: 9.1.3; pg_dump version: 9.0.4

I just used homebrew's upgrade feature, and it brought both the sever and pg_dump versions up to date with the latest version in homebrew (9.3 as of 9/19/13). 我刚刚使用了自制软件的升级功能,它使服务器和pg_dump版本都更新了自制的最新版本(截至2013年9月19日的9.3)。

brew upgrade postgresql

I reran my dump statement, and it worked perfectly. 我重申了我的转储声明,它完美无缺。

pg_dump -U postgres development > dump.sql

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM