PostgresSQL upgrade from 9.6 to 10 on Windows fails when using pg_upgrade (fe_sendauth: no password supplied)

cn flag

Part of the work moving from Windows 2012 to 2019 involves upgrading the current install of Postgres from 9.6 to 10. I'm trying to use pg_upgrade and after some struggle with file permissions I have managed to start the process with the command

pg_upgrade.exe -b "c:/Program Files/PostgreSQL/9.6/bin" -B "d:/PostgreSQL/10/bin" -d "D:/PostgreSQL/9.6/data" -D "D:/PostgreSQL/10/data" --old-port=5432 --new-port=5433 -U postgres -v --check

It starts fine, but after a while it fails like this

"d:/PostgreSQL/10/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "D:/PostgreSQL/10/data" -o "-p 5433 -b -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c vacuum_defer_cleanup_age=0 " start >> "pg_upgrade_server_start.log" 2>&1

connection to database failed: fe_sendauth: no password supplied
could not connect to target postmaster started with the command:
"d:/PostgreSQL/10/bin/pg_ctl" -w -l "pg_upgrade_server.log" -D "D:/PostgreSQL/10/data" -o "-p 5433 -b -c synchronous_commit=off -c fsync=off -c full_page_writes=off -c vacuum_defer_cleanup_age=0 " start

But if I try to run the command by itself, it starts without any issues. I have updated the pg_hba.conf-file so I can issue psql -U postgres -host 5433 without being prompted for password. Other than that I cannot find anything of value in the pg_upgrade*.log files.

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.