diff --git a/contrib/pg_upgrade/option.c b/contrib/pg_upgrade/option.c
index 9b387be21d7ec2954e42ae9ca947fc24292fee08..742d133e391fe58a38188258a729bb8aa11785ac 100644
--- a/contrib/pg_upgrade/option.c
+++ b/contrib/pg_upgrade/option.c
@@ -415,7 +415,7 @@ adjust_data_dir(ClusterInfo *cluster)
 	 * so this might fail --- only works for PG 9.2+.   If this fails,
 	 * pg_upgrade will fail anyway because the data files will not be found.
 	 */
-	snprintf(cmd, sizeof(cmd), "\"%s/postmaster\" -D \"%s\" -C data_directory",
+	snprintf(cmd, sizeof(cmd), "\"%s/postgres\" -D \"%s\" -C data_directory",
 			 cluster->bindir, cluster->pgconfig);
 
 	if ((output = popen(cmd, "r")) == NULL ||