|
14 | 14 |
|
15 | 15 | staticvoidset_locale_and_encoding(ClusterInfo*cluster);
|
16 | 16 | staticvoidcheck_new_cluster_is_empty(void);
|
17 |
| -staticvoidcheck_old_cluster_has_new_cluster_dbs(void); |
18 | 17 | staticvoidcheck_locale_and_encoding(ControlData*oldctrl,
|
19 | 18 | ControlData*newctrl);
|
20 | 19 | staticvoidcheck_is_super_user(ClusterInfo*cluster);
|
@@ -127,7 +126,6 @@ check_new_cluster(void)
|
127 | 126 |
|
128 | 127 | check_new_cluster_is_empty();
|
129 | 128 | check_for_prepared_transactions(&new_cluster);
|
130 |
| -check_old_cluster_has_new_cluster_dbs(); |
131 | 129 |
|
132 | 130 | check_loadable_libraries();
|
133 | 131 |
|
@@ -381,39 +379,6 @@ check_new_cluster_is_empty(void)
|
381 | 379 | }
|
382 | 380 |
|
383 | 381 |
|
384 |
| -/* |
385 |
| - *If someone removes the 'postgres' database from the old cluster and |
386 |
| - *the new cluster has a 'postgres' database, the number of databases |
387 |
| - *will not match. We actually could upgrade such a setup, but it would |
388 |
| - *violate the 1-to-1 mapping of database counts, so we throw an error |
389 |
| - *instead. We would detect this as a database count mismatch during |
390 |
| - *upgrade, but we want to detect it during the check phase and report |
391 |
| - *the database name. |
392 |
| - */ |
393 |
| -staticvoid |
394 |
| -check_old_cluster_has_new_cluster_dbs(void) |
395 |
| -{ |
396 |
| -intold_dbnum, |
397 |
| -new_dbnum; |
398 |
| - |
399 |
| -for (new_dbnum=0;new_dbnum<new_cluster.dbarr.ndbs;new_dbnum++) |
400 |
| -{ |
401 |
| -for (old_dbnum=0;old_dbnum<old_cluster.dbarr.ndbs;old_dbnum++) |
402 |
| -if (strcmp(old_cluster.dbarr.dbs[old_dbnum].db_name, |
403 |
| -new_cluster.dbarr.dbs[new_dbnum].db_name)==0) |
404 |
| -break; |
405 |
| -if (old_dbnum==old_cluster.dbarr.ndbs) |
406 |
| -{ |
407 |
| -if (strcmp(new_cluster.dbarr.dbs[new_dbnum].db_name,"postgres")==0) |
408 |
| -pg_log(PG_FATAL,"The \"postgres\" database must exist in the old cluster\n"); |
409 |
| -else |
410 |
| -pg_log(PG_FATAL,"New cluster database \"%s\" does not exist in the old cluster\n", |
411 |
| -new_cluster.dbarr.dbs[new_dbnum].db_name); |
412 |
| -} |
413 |
| -} |
414 |
| -} |
415 |
| - |
416 |
| - |
417 | 382 | /*
|
418 | 383 | * create_script_for_old_cluster_deletion()
|
419 | 384 | *
|
@@ -462,7 +427,7 @@ create_script_for_old_cluster_deletion(char **deletion_script_file_name)
|
462 | 427 | fprintf(script,RM_CMD" %s%s/PG_VERSION\n",
|
463 | 428 | os_info.tablespaces[tblnum],old_cluster.tablespace_suffix);
|
464 | 429 |
|
465 |
| -for (dbnum=0;dbnum<new_cluster.dbarr.ndbs;dbnum++) |
| 430 | +for (dbnum=0;dbnum<old_cluster.dbarr.ndbs;dbnum++) |
466 | 431 | {
|
467 | 432 | fprintf(script,RMDIR_CMD" %s%s/%d\n",
|
468 | 433 | os_info.tablespaces[tblnum],old_cluster.tablespace_suffix,
|
|