pg_upgrade with brew mac os 9.6.2 - 10.5

我只是一个虾纸丫 提交于 2019-12-25 00:36:07

问题


I've followed the excellent guide here to upgrade from 9.6.2 to 10.5 on mac os 10.11.6. When I get to the step 6

pg_upgrade -b /usr/local/Cellar/postgresql/9.6.2/bin/ \
-B /usr/local/Cellar/postgresql/10.5/bin/ \
-d /usr/local/Cellar/postgres.old/ \
-D /usr/local/Cellar/postgres.new/

I get this error

check for "/usr/local/Cellar/postgresql/9.6.2/bin" failed: No such file or directory

even though mv /usr/local/Cellar/postgresql/9.6.2 /usr/local/Cellar/postgres.old ran ok.

However when I go to

/usr/local/Cellar/postgresql/9.6.2/bin/: No such file or directory

Looking at

$ du -sh /usr/local/var/*/
148K    /usr/local/var/homebrew/
917M    /usr/local/var/log/
202G    /usr/local/var/postgres96/
37M /usr/local/var/postgresql@9.6/

I think my data is still there (postgres96) but don't understand how to get to it and finish pg_upgrade. Any help gratefully appreciated

EDIT;

I think i need to run something like the below to undo the error i made;

undo the move

mv /usr/local/Cellar/postgres.old /usr/local/Cellar/postgresql/9.6.2

Check that worked running

ls /usr/local/Cellar/post*

I should see a bin in the 9.6.2 direcotry and then i can initialize a new cluster data dir:

initdb /usr/local/var/postgres.new

then

pg_upgrade -b /usr/local/Cellar/postgresql/9.6.2/bin/ \
-B /usr/local/Cellar/postgresql/10.5/bin/ \
-d /usr/local/var/postgres96/ \
-D /usr/local/var/postgres.new/

Is that correct?

Given I've backed up with pg_dump

来源:https://stackoverflow.com/questions/53237011/pg-upgrade-with-brew-mac-os-9-6-2-10-5

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!