pg_upgrade on Windows cannot write to log file pg_upgrade_internal.log

前端 未结 1 1509
北海茫月
北海茫月 2021-01-12 07:54

I\'m trying to run pg_upgrade on Windows 2008R2, but I\'m getting the error:

cannot write to log file pg_upgrade_internal.log Failure, exiting

相关标签:
1条回答
  • 2021-01-12 08:40

    So the source code comment at /src/bin/pg_upgrade/file.c#L243 /* fopen() file with no group/other permissions */ gave me an idea.

    I created a temp folder at C:\temp and gave Write permissions to Everyone, and then ran pg_upgrade from that directory, i.e.

    C:\temp>C:\Apps\postgresql\pgsql-9.5.0\bin\pg_upgrade.exe --old-datadir=E:\PGSQL_data --new-datadir=E:\PGSQLData\pgsql-9.5 --old-bindir=C:\Apps\postgresql\pgsql-9.4.5.3\bin --new-bindir=C:\Apps\postgresql\pgsql-9.5.0\bin

    Whereas before I was trying to run pg_upgrade from the working directory %PGSQL%\bin which did not have a Write permissions to Everyone.

    Now I don't get the cannot write to log file pg_upgrade_internal.log error anymore.

    The docs actually say pg_upgrade requires write permission in the current directory.

    0 讨论(0)
提交回复
热议问题