]> granicus.if.org Git - postgresql/commitdiff
Fix pg_upgrade crash
authorBruce Momjian <bruce@momjian.us>
Wed, 13 Apr 2011 15:33:55 +0000 (11:33 -0400)
committerBruce Momjian <bruce@momjian.us>
Wed, 13 Apr 2011 15:33:55 +0000 (11:33 -0400)
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.

contrib/pg_upgrade/relfilenode.c

index b20ca200f182e531b5119f07f8121569ad46e8d5..fc36968f99d8ad03353fad54aa0cbd0ced330a0b 100644 (file)
@@ -46,6 +46,10 @@ transfer_all_new_dbs(migratorContext *ctx, DbInfoArr *olddb_arr,
                int                     n_maps;
                pageCnvCtx *pageConverter = NULL;
 
+               if (!old_db)
+                       pg_log(ctx, PG_FATAL,
+                          "the new cluster database %s was not found in the old cluster\n", new_db->db_name);
+               
                n_maps = 0;
                mappings = gen_db_file_maps(ctx, old_db, new_db, &n_maps, old_pgdata,
                                                                        new_pgdata);