0

During upgrade from PostgreSQL 8.4.8 to PostgreSQL 9.5.2 on Windows OS, i got the following error over command line:

Running in verbose mode

cannot write to log file pg_upgrade_internal.log
Failure, exiting

When I checked the file pg_upgrade_internal.log, it contained following data:

Running in verbose mode

-----------------------------------------------------------------
  pg_upgrade run on Tue Apr 24 17:02:13 2018
-----------------------------------------------------------------

Other files like pg_upgrade_server.log , pg_upgrade_utility.log, pg_upgrade_server_start.log, which are generated by pg_upgrade utility, also contain partial data:

-----------------------------------------------------------------
  pg_upgrade run on Tue Apr 24 17:02:13 2018
-----------------------------------------------------------------

If pg_upgrade utility failed to write (or in other words, did not have permission), then who wrote the above data ? I am sure that these logs were written by PostgreSQL utility only.

BTW, I have already checked the Stackoverflow, PostgreSQL site links (link1, link2, etc.) which describe the cannot write... error issue, but none of those links mention this issue/concern.

user
  • 383
  • 1
  • 5
  • 20
  • Check the owner of the log file (and the directory where it lives in). Also check the userid that executes the pg_upgrade process. – joop May 03 '18 at 09:42
  • I cannot check it as the issue occurred on a remote system, for which I do not have access to. I only have the logs. But I can tell you that, logged in account was an admin account and `pg_upgrade` utility was executed through that user only. – user May 03 '18 at 09:48

1 Answers1

0

Adding this for reference even though the question is old.

I had the same problem as above and none of the solutions seemed to work.

In my case it seems that the issue was caused by using the machines "Administrator" user with a elevated cmd prompt. I "fixed" the problem by using a normal user, with the correct security permissions on the Postgres data directories.

AndyHamp
  • 37
  • 4