]> granicus.if.org Git - postgresql/commitdiff
Clarify pg_upgrade error message that the 'postgres' database must exist
authorBruce Momjian <bruce@momjian.us>
Fri, 28 Oct 2011 12:07:30 +0000 (08:07 -0400)
committerBruce Momjian <bruce@momjian.us>
Fri, 28 Oct 2011 12:09:15 +0000 (08:09 -0400)
in the old cluster.

contrib/pg_upgrade/check.c

index 5b9b4cd3d5a3541eb9c971b6914bdbb080c61a04..e400814617b82c9561692d2303afa7e90d994dbe 100644 (file)
@@ -403,8 +403,13 @@ check_old_cluster_has_new_cluster_dbs(void)
                                           new_cluster.dbarr.dbs[new_dbnum].db_name) == 0)
                                break;
                if (old_dbnum == old_cluster.dbarr.ndbs)
-                       pg_log(PG_FATAL, "New cluster database \"%s\" does not exist in the old cluster\n",
-                                  new_cluster.dbarr.dbs[new_dbnum].db_name);
+               {
+                       if (strcmp(new_cluster.dbarr.dbs[new_dbnum].db_name, "postgres") == 0)
+                               pg_log(PG_FATAL, "The \"postgres\" database must exist in the old cluster\n");
+                       else
+                               pg_log(PG_FATAL, "New cluster database \"%s\" does not exist in the old cluster\n",
+                                          new_cluster.dbarr.dbs[new_dbnum].db_name);
+               }
        }
 }