pg_upgrade --link fails on Windows Server 2019 with hard link error
A pg_upgrade run migrating a cluster from PostgreSQL 10 to 12 stopped with a hard link failure, reported as [unrecognized win32 error code: 50], [could not create hard link between old and new data directories: Invalid argument] and the accompanying explanation that in link mode the two data directories must sit on the same file system.
The command used was:
D:PostgreSQLbinpg_upgrade --old-datadir=D:OldPostgreSQLdata --new-datadir=D:PostgreSQLdata --old-bindir=D:OldPostgreSQLbin --new-bindir=D:PostgreSQLbin --old-port=5433 --new-port=49121 --username=postgres --retain --link
Claimed cause under investigation: whether a mounting issue between the old and the new data directory is behind the failure. Two details narrow it down: the problem appears on only one machine, and that machine runs Windows Server 2019. The reporter has asked for help resolving it. Reply



