mirror of
https://github.com/postgres/postgres.git
synced 2025-07-27 12:41:57 +03:00
Fix bug in 9.1 pg_upgrade processing of old/new relations; adjust debug
output.
This commit is contained in:
@ -48,7 +48,7 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
|
|||||||
for (relnum = 0; relnum < old_db->rel_arr.nrels; relnum++)
|
for (relnum = 0; relnum < old_db->rel_arr.nrels; relnum++)
|
||||||
{
|
{
|
||||||
RelInfo *old_rel = &old_db->rel_arr.rels[relnum];
|
RelInfo *old_rel = &old_db->rel_arr.rels[relnum];
|
||||||
RelInfo *new_rel = &old_db->rel_arr.rels[relnum];
|
RelInfo *new_rel = &new_db->rel_arr.rels[relnum];
|
||||||
|
|
||||||
if (old_rel->reloid != new_rel->reloid)
|
if (old_rel->reloid != new_rel->reloid)
|
||||||
pg_log(PG_FATAL, "mismatch of relation id: database \"%s\", old relid %d, new relid %d\n",
|
pg_log(PG_FATAL, "mismatch of relation id: database \"%s\", old relid %d, new relid %d\n",
|
||||||
@ -147,7 +147,8 @@ get_db_and_rel_infos(ClusterInfo *cluster)
|
|||||||
{
|
{
|
||||||
int dbnum;
|
int dbnum;
|
||||||
|
|
||||||
free_db_and_rel_infos(&cluster->dbarr);
|
if (cluster->dbarr.dbs != NULL)
|
||||||
|
free_db_and_rel_infos(&cluster->dbarr);
|
||||||
|
|
||||||
get_db_infos(cluster);
|
get_db_infos(cluster);
|
||||||
|
|
||||||
@ -156,7 +157,7 @@ get_db_and_rel_infos(ClusterInfo *cluster)
|
|||||||
|
|
||||||
if (log_opts.debug)
|
if (log_opts.debug)
|
||||||
{
|
{
|
||||||
pg_log(PG_DEBUG, "%s databases\n", CLUSTER_NAME(cluster));
|
pg_log(PG_DEBUG, "\n%s databases:\n", CLUSTER_NAME(cluster));
|
||||||
print_db_infos(&cluster->dbarr);
|
print_db_infos(&cluster->dbarr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -319,6 +320,7 @@ free_db_and_rel_infos(DbInfoArr *db_arr)
|
|||||||
for (dbnum = 0; dbnum < db_arr->ndbs; dbnum++)
|
for (dbnum = 0; dbnum < db_arr->ndbs; dbnum++)
|
||||||
free_rel_infos(&db_arr->dbs[dbnum].rel_arr);
|
free_rel_infos(&db_arr->dbs[dbnum].rel_arr);
|
||||||
pg_free(db_arr->dbs);
|
pg_free(db_arr->dbs);
|
||||||
|
db_arr->dbs = NULL;
|
||||||
db_arr->ndbs = 0;
|
db_arr->ndbs = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user