Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ana19-0007eJ-MI for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Apr 2016 23:04:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ana19-0000v2-98 for pgsql-bugs@arkaria.postgresql.org; Tue, 05 Apr 2016 23:04:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ana0W-000077-0y for pgsql-bugs@postgresql.org; Tue, 05 Apr 2016 23:03:36 +0000 Received: from hogranch.com ([75.101.82.47]) by magus.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ana0N-0000HK-1Z for pgsql-bugs@postgresql.org; Tue, 05 Apr 2016 23:03:35 +0000 Received: from [192.168.0.2] (porker [192.168.0.2]) by hogranch.com (8.11.6/8.11.6) with ESMTP id u35M3Em27922; Tue, 5 Apr 2016 15:03:14 -0700 Subject: Re: pg_upgrade on Windows To: pgsql-bugs@postgresql.org, marc@daelemans.com References: <003001d18f87$447facf0$cd7f06d0$@daelemans.com> From: John R Pierce Message-ID: <5704443D.1080703@hogranch.com> Date: Tue, 5 Apr 2016 16:03:25 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.7.1 MIME-Version: 1.0 In-Reply-To: <003001d18f87$447facf0$cd7f06d0$@daelemans.com> Content-Type: multipart/alternative; boundary="------------070308080400090308030509" X-HawgScanner-Information: Please contact the ISP for more information X-HawgScanner: Found to be clean X-Pg-Spam-Score: -2.9 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This is a multi-part message in MIME format. --------------070308080400090308030509 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 4/5/2016 3:05 PM, Marc Daelemans wrote: > > When one attempts to run pg_upgrade on Windows (7 SP 1 x64) the > command produces a failure notice, probably because writing to (log) > files in C:\Program Files and its subdirectories is not allowed. > > C:\Program Files\PostgreSQL\9.5>pg_upgrade.exe --old-datadir > "C:/Program Files/PostgreSQL/9.4/data" --new-datadir "C:/Program > Files/PostgreSQL/9.5/data" --old-bindir "C:/Program > Files/PostgreSQL/9.4/bin" --new-bindir "C:/Program > Files/PostgreSQL/9.5/bin" > > cannot write to log file pg_upgrade_internal.log > > Failure, exiting > > Is there a way to redirect the log file to another file location? > wild guess says its writing that to the current default directory. try running it from a directory you have write access to, such as c:\Users\MyUsername and specify the path for pg_upgrade, like... C:\Users\MyUsername> C:\Program Files\PostgreSQL\9.5\bin\pg_upgrade --old-datadir "C:/Program Files/PostgreSQL/9.4/data" --new-datadir "C:/Program Files/PostgreSQL/9.5/data" --old-bindir "C:/Program Files/PostgreSQL/9.4/bin" --new-bindir "C:/Program Files/PostgreSQL/9.5/bin" -- john r pierce, recycling bits in santa cruz --------------070308080400090308030509 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit
On 4/5/2016 3:05 PM, Marc Daelemans wrote:

When one attempts to run pg_upgrade on Windows (7 SP 1 x64) the command produces a failure notice, probably because writing to (log) files in C:\Program Files and its subdirectories is not allowed.

 C:\Program Files\PostgreSQL\9.5>pg_upgrade.exe --old-datadir "C:/Program Files/PostgreSQL/9.4/data" --new-datadir "C:/Program Files/PostgreSQL/9.5/data" --old-bindir "C:/Program Files/PostgreSQL/9.4/bin" --new-bindir "C:/Program Files/PostgreSQL/9.5/bin"

 cannot write to log file pg_upgrade_internal.log

Failure, exiting

 Is there a way to redirect the log file to another file location?


wild guess says its writing that to the current default directory.

try running it from a directory you have write access to, such as c:\Users\MyUsername   and specify the path for pg_upgrade, like...

C:\Users\MyUsername> C:\Program Files\PostgreSQL\9.5\bin\pg_upgrade --old-datadir "C:/Program Files/PostgreSQL/9.4/data" --new-datadir "C:/Program Files/PostgreSQL/9.5/data" --old-bindir "C:/Program Files/PostgreSQL/9.4/bin" --new-bindir "C:/Program Files/PostgreSQL/9.5/bin"


-- 
john r pierce, recycling bits in santa cruz
--------------070308080400090308030509--