1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-30 11:03:19 +03:00

Throw error for mismatched pg_upgrade clusters

If someone removes the 'postgres' database from the old cluster and the
new cluster has a 'postgres' database, the number of databases will not
match.  We actually could upgrade such a setup, but it would violate the
1-to-1 mapping of database counts, so we throw an error instead.

Previously they got an error during the upgrade, and not at the check
stage; PG 9.0.4 does the same.
This commit is contained in:
Bruce Momjian
2011-04-19 21:00:29 -04:00
parent 0341944706
commit 7228d02989
2 changed files with 34 additions and 18 deletions

View File

@ -37,12 +37,6 @@ transfer_all_new_dbs(DbInfoArr *old_db_arr,
prep_status("Restoring user relation files\n");
/*
* If the user removed the 'postgres' database from the old cluster,
* this will cause the database counts to not match and throw an error.
* We could allow this to work because the new database is empty (we
* checked), but we don't.
*/
if (old_db_arr->ndbs != new_db_arr->ndbs)
pg_log(PG_FATAL, "old and new clusters have a different number of databases\n");