@@ -54,6 +54,7 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
5454if (strcmp (old_rel -> nspname ,"pg_toast" )== 0 )
5555continue ;
5656
57+ /* old/new non-toast relation names match */
5758new_rel = relarr_lookup_rel_name (& new_cluster ,& new_db -> rel_arr ,
5859old_rel -> nspname ,old_rel -> relname );
5960
@@ -70,6 +71,7 @@ gen_db_file_maps(DbInfo *old_db, DbInfo *new_db,
7071char old_name [MAXPGPATH ],new_name [MAXPGPATH ];
7172RelInfo * old_toast ,* new_toast ;
7273
74+ /* use the toast relids from the rel_arr for lookups */
7375old_toast = relarr_lookup_rel_oid (& old_cluster ,& old_db -> rel_arr ,
7476old_rel -> toastrelid );
7577new_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,
7981old_toast ,new_toast ,maps + num_maps );
8082num_maps ++ ;
8183
82- /*
83- * We also need to provide a mapping for the index of this toast
84- * relation. The procedure is similar to what we did above for
85- * toast relation itself, the only difference being that the
86- * relnames need to be appended with _index.
87- */
84+ /* toast indexes are the same, except with an "_index" suffix */
8885snprintf (old_name ,sizeof (old_name ),"%s_index" ,old_toast -> relname );
8986snprintf (new_name ,sizeof (new_name ),"%s_index" ,new_toast -> relname );
9087