diff options
author | Bruce Momjian <bruce@momjian.us> | 2011-04-13 11:33:55 -0400 |
---|---|---|
committer | Bruce Momjian <bruce@momjian.us> | 2011-04-13 11:33:55 -0400 |
commit | 052e621cc2c25166037fe9fadd3082ae70045fec (patch) | |
tree | 113220ac6ee0044fe8a946038be138bdfc094da8 | |
parent | e910bd2dfee154c2b010befac4f9b28bbc46003a (diff) | |
download | postgresql-052e621cc2c25166037fe9fadd3082ae70045fec.tar.gz postgresql-052e621cc2c25166037fe9fadd3082ae70045fec.zip |
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.
-rw-r--r-- | contrib/pg_upgrade/relfilenode.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/contrib/pg_upgrade/relfilenode.c b/contrib/pg_upgrade/relfilenode.c index b20ca200f18..fc36968f99d 100644 --- a/contrib/pg_upgrade/relfilenode.c +++ b/contrib/pg_upgrade/relfilenode.c @@ -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); |