Skip to content

Commit 0341944

Browse files
committed
Add C comment
Add C comment about why we throw an error if the pg_upgrade old/new database counts don't match.
1 parent 8c19977 commit 0341944

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

contrib/pg_upgrade/relfilenode.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,12 @@ transfer_all_new_dbs(DbInfoArr *old_db_arr,
3737

3838
prep_status("Restoring user relation files\n");
3939

40+
/*
41+
* If the user removed the 'postgres' database from the old cluster,
42+
* this will cause the database counts to not match and throw an error.
43+
* We could allow this to work because the new database is empty (we
44+
* checked), but we don't.
45+
*/
4046
if (old_db_arr->ndbs != new_db_arr->ndbs)
4147
pg_log(PG_FATAL, "old and new clusters have a different number of databases\n");
4248

0 commit comments

Comments
 (0)