aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2011-01-08 08:01:12 -0500
committerBruce Momjian <bruce@momjian.us>2011-01-08 08:01:52 -0500
commita60b32b3dcb4d49a60c96558ce405764ac17c799 (patch)
tree50ee2f664dcbf485b46e7b5f999cd5dc9f10ed6e
parentaf84bee43e356866dc46c95ae5bf77996a8237ff (diff)
downloadpostgresql-a60b32b3dcb4d49a60c96558ce405764ac17c799.tar.gz
postgresql-a60b32b3dcb4d49a60c96558ce405764ac17c799.zip
In pg_upgrade, remove unnecessary separate handling of toast tables now
that we restore by oid; they can be handled like regular tables when creating the file mapping structure.
-rw-r--r--contrib/pg_upgrade/info.c37
1 files changed, 0 insertions, 37 deletions
diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c
index 4360d39d334..50e4de2bf6b 100644
--- a/contrib/pg_upgrade/info.c
+++ b/contrib/pg_upgrade/info.c
@@ -50,10 +50,6 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
RelInfo *old_rel = &old_db->rel_arr.rels[relnum];
RelInfo *new_rel;
- /* toast tables are handled by their parents */
- if (strcmp(old_rel->nspname, "pg_toast") == 0)
- continue;
-
/* old/new relation names always match */
new_rel = relarr_lookup_rel_name(&new_cluster, &new_db->rel_arr,
old_rel->nspname, old_rel->relname);
@@ -61,39 +57,6 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
create_rel_filename_map(old_pgdata, new_pgdata, old_db, new_db,
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 (old_rel->toastrelid > 0)
- {
- char old_name[MAXPGPATH], new_name[MAXPGPATH];
- RelInfo *old_toast, *new_toast;
-
- /* use the toast relids from the rel_arr for lookups */
- old_toast = relarr_lookup_rel_oid(&old_cluster, &old_db->rel_arr,
- old_rel->toastrelid);
- new_toast = relarr_lookup_rel_oid(&new_cluster, &new_db->rel_arr,
- new_rel->toastrelid);
-
- create_rel_filename_map(old_pgdata, new_pgdata, old_db, new_db,
- old_toast, new_toast, maps + num_maps);
- num_maps++;
-
- /* toast indexes are the same, except with an "_index" suffix */
- snprintf(old_name, sizeof(old_name), "%s_index", old_toast->relname);
- snprintf(new_name, sizeof(new_name), "%s_index", new_toast->relname);
-
- old_toast = relarr_lookup_rel_name(&old_cluster, &old_db->rel_arr,
- "pg_toast", old_name);
- new_toast = relarr_lookup_rel_name(&new_cluster, &new_db->rel_arr,
- "pg_toast", new_name);
-
- create_rel_filename_map(old_pgdata, new_pgdata, old_db,
- new_db, old_toast, new_toast, maps + num_maps);
- num_maps++;
- }
}
*nmaps = num_maps;