Skip to content

Commit 052e621

Browse files
committed
Fix pg_upgrade crash
Fix pg_upgrade crash in 9.0 caused by a new cluster database that doesn't exist in the old cluster; instead throw an error. This was reported to me by EnterpriseDB testing staff. This bug does not exist in git head.
1 parent e910bd2 commit 052e621

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

contrib/pg_upgrade/relfilenode.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ transfer_all_new_dbs(migratorContext *ctx, DbInfoArr *olddb_arr,
4646
int n_maps;
4747
pageCnvCtx *pageConverter = NULL;
4848

49+
if (!old_db)
50+
pg_log(ctx, PG_FATAL,
51+
"the new cluster database %s was not found in the old cluster\n", new_db->db_name);
52+
4953
n_maps = 0;
5054
mappings = gen_db_file_maps(ctx, old_db, new_db, &n_maps, old_pgdata,
5155
new_pgdata);

0 commit comments

Comments
 (0)