@@ -104,6 +104,12 @@ create_rel_filename_map(const char *old_data, const char *new_data,
104
104
/* new_relfilenode will match old and new pg_class.oid */
105
105
map -> new_relfilenode = new_rel -> relfilenode ;
106
106
107
+ if (strcmp (old_rel -> nspname ,new_rel -> nspname )!= 0 ||
108
+ strcmp (old_rel -> relname ,new_rel -> relname )!= 0 )
109
+ pg_log (PG_FATAL ,"mismatch of relation id: database \"%s\", old rel %s.%s, new rel %s.%s\n" ,
110
+ old_db ,old_rel -> nspname ,old_rel -> relname ,
111
+ new_rel -> nspname ,new_rel -> relname );
112
+
107
113
/* used only for logging and error reporing, old/new are identical */
108
114
snprintf (map -> nspname ,sizeof (map -> nspname ),"%s" ,old_rel -> nspname );
109
115
snprintf (map -> relname ,sizeof (map -> relname ),"%s" ,old_rel -> relname );
@@ -141,6 +147,9 @@ get_db_and_rel_infos(ClusterInfo *cluster)
141
147
{
142
148
int dbnum ;
143
149
150
+ if (cluster -> dbarr )
151
+ free_db_and_rel_infos (cluster -> dbarr );
152
+
144
153
get_db_infos (cluster );
145
154
146
155
for (dbnum = 0 ;dbnum < cluster -> dbarr .ndbs ;dbnum ++ )