I wanted to ugrade my postgresql database from v10 to v14
I have run these commands in windows command prompt:
C:\Users\mahajan>CD C:\Program Files\PostgreSQL\14\bin
C:\Program Files\PostgreSQL\14\bin>SET PGPASSWORD =1234
pg_upgrade -d "c:\Program Files\PostgreSQL\10\data" -D"c:\Program Files\PostgreSQL\14\data" -b "c:\Program Files\PostgreSQL\10\bin" -B "c:\Program Files\PostgreSQL\14\bin" -U Postgres
could not open log file "pg_upgrade_internal.log": Permission denied
Failure, exiting
C:\Program Files\PostgreSQL\14\bin>cd "C:\Users\santo\Downloads\Temp"
C:\Users\mahajan\Downloads\Temp>SET PGPASSWORD=1234
C:\Users\mahajan\Downloads\Temp>"c:\Program Files\PostgreSQL\14\bin\pg_upgrade.exe" -d "c:\Program Files\PostgreSQL\10\data" -D"c:\Program Files\PostgreSQL\14\data" -b "c:\Program Files\PostgreSQL\10\bin" -B "c:\Program Files\PostgreSQL\14\bin" -U postgres
I have got ERROR like
How to resolve this error?
pg_upgrade_internal.log:
-----------------------------------------------------------------
pg_upgrade run on Wed Apr 6 11:06:21 2022
-----------------------------------------------------------------
-----------------------------------------------------------------
pg_upgrade run on Wed Apr 6 11:06:21 2022
-----------------------------------------------------------------
connection to server at "localhost" (::1), port 50432 failed: FATAL: password authentication failed for user "Postgres"
could not connect to target postmaster started with the command:
"c:/Program Files/PostgreSQL/14/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "c:/Program Files/PostgreSQL/14/data" -o "-p 50432 -c autovacuum=off -c autovacuum_freeze_max_age=2000000000 -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c vacuum_defer_cleanup_age=0 " start
ERROR:
Microsoft Windows [Version 10.0.22000.556]
(c) Microsoft Corporation. All rights reserved.
C:\Windows\system32>SET PGPASSWORD =1234
C:\Windows\system32>pg_upgrade -d "c:\Program Files\PostgreSQL\10\data" -D"c:\Program Files\PostgreSQL\14\data" -b "c:\Program Files\PostgreSQL\10\bin" -B "c:\Program Files\PostgreSQL\14\bin" -U Postgres
'pg_upgrade' is not recognized as an internal or external command,
operable program or batch file.