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
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.