From: Bruce Momjian Date: Wed, 5 Jan 2011 19:09:01 +0000 (-0500) Subject: Update pg_upgrade C comments. X-Git-Tag: REL9_1_ALPHA4~518 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e66e43988a334ca58c584a0652d29dff61e698b9;p=postgresql Update pg_upgrade C comments. --- diff --git a/contrib/pg_upgrade/info.c b/contrib/pg_upgrade/info.c index 01adc33f08..578bdb9eae 100644 --- a/contrib/pg_upgrade/info.c +++ b/contrib/pg_upgrade/info.c @@ -54,6 +54,7 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db, if (strcmp(old_rel->nspname, "pg_toast") == 0) continue; + /* old/new non-toast relation names match */ new_rel = relarr_lookup_rel_name(&new_cluster, &new_db->rel_arr, old_rel->nspname, old_rel->relname); @@ -70,6 +71,7 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db, 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, @@ -79,12 +81,7 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db, old_toast, new_toast, maps + num_maps); num_maps++; - /* - * We also need to provide a mapping for the index of this toast - * relation. The procedure is similar to what we did above for - * toast relation itself, the only difference being that the - * relnames need to be appended with _index. - */ + /* 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);