与 vagrant 一起使用时无法启动 postgresql

Tho*_*eil 3 postgresql vagrant

尝试在 Vagrant 管理的 Virtualbox VM 上启动 postgresql 我有以下错误:

LOG:  could not link file "pg_xlog/xlogtemp.29" to "pg_xlog/000000010000000000000001" (initialization of log file): Operation not permitted
FATAL:  could not open file "pg_xlog/000000010000000000000001": No such file or directory
Run Code Online (Sandbox Code Playgroud)

``

Tho*_*eil 5

当 postgresql 的数据目录在 Vagrant 共享文件夹(/vagrant例如)中,并且 Vagrant 主机是 Windows时,就会发生这种情况。在这种情况下,无法以 unix 方式设置权限。

将该文件夹移动到另一个位置(例如 vagrant 用户的主目录),postgresql 将启动。

解决方案见:https : //gitlab.com/gitlab-org/gitlab-development-kit/issues/20