From: Bruce Momjian Date: Wed, 5 Jan 2011 18:52:44 +0000 (-0500) Subject: Fix for recent pg_upgrade commit to fix large objects relfilenode X-Git-Tag: REL9_1_ALPHA4~519 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a45beaac642147ebf2e561cce62967d244c343c6;p=postgresql Fix for recent pg_upgrade commit to fix large objects relfilenode handling. (metadata user ids still an open issue). --- diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c index 83afb92688..01adc33f08 100644 --- a/contrib/pg_upgrade/info.c +++ b/contrib/pg_upgrade/info.c @@ -47,33 +47,33 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db, for (relnum = 0; relnum < old_db->rel_arr.nrels; relnum++) { - RelInfo *oldrel = &old_db->rel_arr.rels[relnum]; - RelInfo *newrel; + RelInfo *old_rel = &old_db->rel_arr.rels[relnum]; + RelInfo *new_rel; /* toast tables are handled by their parents */ - if (strcmp(oldrel->nspname, "pg_toast") == 0) + if (strcmp(old_rel->nspname, "pg_toast") == 0) continue; - newrel = relarr_lookup_rel_name(&old_cluster, &old_db->rel_arr, - oldrel->nspname, oldrel->relname); + new_rel = relarr_lookup_rel_name(&new_cluster, &new_db->rel_arr, + old_rel->nspname, old_rel->relname); create_rel_filename_map(old_pgdata, new_pgdata, old_db, new_db, - oldrel, newrel, maps + num_maps); + old_rel, new_rel, maps + num_maps); num_maps++; /* * So much for mapping this relation; now we need a mapping * for its corresponding toast relation and toast index, if any. */ - if (oldrel->toastrelid > 0) + if (old_rel->toastrelid > 0) { char old_name[MAXPGPATH], new_name[MAXPGPATH]; RelInfo *old_toast, *new_toast; old_toast = relarr_lookup_rel_oid(&old_cluster, &old_db->rel_arr, - oldrel->toastrelid); + old_rel->toastrelid); new_toast = relarr_lookup_rel_oid(&new_cluster, &new_db->rel_arr, - newrel->toastrelid); + new_rel->toastrelid); create_rel_filename_map(old_pgdata, new_pgdata, old_db, new_db, old_toast, new_toast, maps + num_maps);