从 Postgresql 9.1 升级到 9.3 时“无法写入日志文件 pg_upgrade_internal.log”
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23216734/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
"cannot write to log file pg_upgrade_internal.log" when upgrading from Postgresql 9.1 to 9.3
提问by Constantine M
I keep on getting the above error whenever I run the following command via a postgres user.
每当我通过 postgres 用户运行以下命令时,我都会不断收到上述错误。
/usr/lib/postgresql/9.3/bin/pg_upgrade \
-b /usr/lib/postgresql/9.1/bin/ \
-B /usr/lib/postgresql/9.3/bin/ \
-d /var/lib/postgresql/9.1/main \
-D /var/lib/postgresql/9.3/main
cannot write to log file pg_upgrade_internal.log Failure, exiting
无法写入日志文件 pg_upgrade_internal.log 失败,正在退出
I'm using Ubuntu 13.10. Both Postgresql 9.1 and 9.3 are running properly.
我正在使用 Ubuntu 13.10。Postgresql 9.1 和 9.3 都运行正常。
回答by Daniel Vérité
Make sure that you run this command from a directory that is writable by the postgres
user, like /tmp
or /var/lib/postgresql
:
确保从postgres
用户可写的目录中运行此命令,例如/tmp
或/var/lib/postgresql
:
$ cd /tmp
$ usr/lib/postgresql/9.3/bin/pg_upgrade ...