Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"cannot write to log file pg_upgrade_internal.log" when upgrading from Postgresql 9.1 to 9.3

I keep on getting the above error whenever I run the following command via a postgres user.

/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

I'm using Ubuntu 13.10. Both Postgresql 9.1 and 9.3 are running properly.

like image 426
Constantine M Avatar asked Apr 22 '14 10:04

Constantine M


1 Answers

Make sure that you run this command from a directory that is writable by the postgres user, like /tmp or /var/lib/postgresql:

$ cd /tmp
$ usr/lib/postgresql/9.3/bin/pg_upgrade ...
like image 54
Daniel Vérité Avatar answered Oct 30 '22 22:10

Daniel Vérité