Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 9846dcf

Browse files
committed
Clarify pg_upgrade error message that the 'postgres' database must exist
in the old cluster.
1 parent ece1265 commit 9846dcf

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

contrib/pg_upgrade/check.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -403,8 +403,13 @@ check_old_cluster_has_new_cluster_dbs(void)
403403
new_cluster.dbarr.dbs[new_dbnum].db_name) == 0)
404404
break;
405405
if (old_dbnum == old_cluster.dbarr.ndbs)
406-
pg_log(PG_FATAL, "New cluster database \"%s\" does not exist in the old cluster\n",
407-
new_cluster.dbarr.dbs[new_dbnum].db_name);
406+
{
407+
if (strcmp(new_cluster.dbarr.dbs[new_dbnum].db_name, "postgres") == 0)
408+
pg_log(PG_FATAL, "The \"postgres\" database must exist in the old cluster\n");
409+
else
410+
pg_log(PG_FATAL, "New cluster database \"%s\" does not exist in the old cluster\n",
411+
new_cluster.dbarr.dbs[new_dbnum].db_name);
412+
}
408413
}
409414
}
410415

0 commit comments

Comments
 (0)