diff --git a/contrib/pg_upgrade/check.c b/contrib/pg_upgrade/check.c
index 26dec39b35b6acdc9e71283aa28d60dbebe26afc..ac290c4a2b23ca2b835adffdf0e3dd9033b3ae78 100644
--- a/contrib/pg_upgrade/check.c
+++ b/contrib/pg_upgrade/check.c
@@ -491,7 +491,8 @@ check_is_super_user(ClusterInfo *cluster)
 							"WHERE rolname = current_user");
 
 	if (PQntuples(res) != 1 || strcmp(PQgetvalue(res, 0, 0), "t") != 0)
-		pg_log(PG_FATAL, "the database user is not a superuser\n");
+		pg_log(PG_FATAL, "database user \"%s\" is not a superuser\n",
+		os_info.user);
 
 	PQclear(res);