在MacOS X上不匹配pg_dump

时间:2022-01-28 02:53:02

Locally, it appears that I have Postgresql 9.2.4 installed. I am guessing based off the last error message I received that I do not have the latest version:

在本地,似乎已经安装了Postgresql 9.2.4。根据我收到的最后一条错误信息,我猜测我没有最新的版本:

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

On other posts here, what was told to do was to add the following the the .profile and then run the command:

在这里的其他文章中,要做的是添加以下.profile,然后运行命令:

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

which did not work.

没有工作。

2 weeks ago, I installed Postgresql with the simple command:

两周前,我使用简单的命令安装了Postgresql:

brew install postgresql

and that gave me the version I currently have. It appears as I don't have the latest version then.

这给了我现在的版本。看起来好像我没有最新的版本。

How can I a) upgrade to 9.3.1 (which is what the server version looks to be) or b) do one of these fixes like the one I attempted above which did not work.

我如何能a)升级到9.3.1(这是服务器版本的样子)或b)做其中一个修复,就像我上面尝试过的,但是没有成功。

I am very new to Postgresql so a step by step would be very helpful for me.

我对Postgresql很不熟悉,所以一步一步对我很有帮助。

2 个解决方案

#1


3  

brew upgrade postgresql
brew link --overwrite postgresql

#2


-1  

There are upgrade instructions you have to follow between Postgresql 9.2 and 9.3...

在Postgresql 9.2和9.3之间需要遵循升级指令。

  1. launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
  2. launchctl卸载~ /图书馆/ LaunchAgents / homebrew.mxcl.postgresql.plist
  3. mv /usr/local/var/postgres /usr/local/var/postgres92
  4. mv /usr/local/var/postgres /usr/local/var/postgres92
  5. brew update
  6. 酿造更新
  7. brew upgrade postgresql
  8. 酿造升级postgresql
  9. initdb /usr/local/var/postgres -E utf8
  10. initdb /usr/local/var/postgres - e utf8
  11. pg_upgrade -b /usr/local/Cellar/postgresql/9.2.4/bin -B /usr/local/Cellar/postgresql/9.3.1/bin -d /usr/local/var/postgres92 -D /usr/local/var/postgres
  12. pg_upgrade -b /usr/ local/cellar/postgresql / 9.4 /bin -b /usr/local/Cellar/postgresql/9.3.1/bin -d /usr/local/var/postgres92 -d /usr/local/var/ var/postgres92 -d /postgres92
  13. launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
  14. ~ /图书馆/ LaunchAgents / homebrew.mxcl.postgresql.plist launchctl负载

#1


3  

brew upgrade postgresql
brew link --overwrite postgresql

#2


-1  

There are upgrade instructions you have to follow between Postgresql 9.2 and 9.3...

在Postgresql 9.2和9.3之间需要遵循升级指令。

  1. launchctl unload ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
  2. launchctl卸载~ /图书馆/ LaunchAgents / homebrew.mxcl.postgresql.plist
  3. mv /usr/local/var/postgres /usr/local/var/postgres92
  4. mv /usr/local/var/postgres /usr/local/var/postgres92
  5. brew update
  6. 酿造更新
  7. brew upgrade postgresql
  8. 酿造升级postgresql
  9. initdb /usr/local/var/postgres -E utf8
  10. initdb /usr/local/var/postgres - e utf8
  11. pg_upgrade -b /usr/local/Cellar/postgresql/9.2.4/bin -B /usr/local/Cellar/postgresql/9.3.1/bin -d /usr/local/var/postgres92 -D /usr/local/var/postgres
  12. pg_upgrade -b /usr/ local/cellar/postgresql / 9.4 /bin -b /usr/local/Cellar/postgresql/9.3.1/bin -d /usr/local/var/postgres92 -d /usr/local/var/ var/postgres92 -d /postgres92
  13. launchctl load ~/Library/LaunchAgents/homebrew.mxcl.postgresql.plist
  14. ~ /图书馆/ LaunchAgents / homebrew.mxcl.postgresql.plist launchctl负载