@@ -59,6 +59,12 @@ fix_path_separator(char *path)
59
59
#endif
60
60
}
61
61
62
+ #define same_version_edition (cluster1 , cluster2 ) \
63
+ ( \
64
+ GET_MAJOR_VERSION((cluster1).major_version) == GET_MAJOR_VERSION((cluster2).major_version) \
65
+ && (cluster1).edition == (cluster2).edition \
66
+ )
67
+
62
68
void
63
69
output_check_banner (bool live_check )
64
70
{
@@ -113,7 +119,7 @@ check_and_dump_old_cluster(bool live_check)
113
119
* PgPro 10 Enterprise requires hash indexes to be reindexed regardless
114
120
* of old cluster version
115
121
*/
116
- if (user_opts .check )
122
+ if (user_opts .check && ! same_version_edition ( old_cluster , new_cluster ) )
117
123
old_9_6_invalidate_hash_indexes (& old_cluster , true);
118
124
119
125
/* 9.5 and below should not have roles starting with pg_ */
@@ -206,23 +212,27 @@ issue_warnings_and_set_wal_level(void)
206
212
* Reindex hash indexes for old < 10.0
207
213
* PgPro 10 Enterprise requires hash indexes to be reindexed
208
214
*/
209
- old_9_6_invalidate_hash_indexes (& new_cluster , false);
215
+ if (!same_version_edition (old_cluster , new_cluster ))
216
+ old_9_6_invalidate_hash_indexes (& new_cluster , false);
210
217
211
218
/* Invalidate incompatible indexes */
212
219
/*
213
220
* TODO: should we try to convert sp-gist indexes when upgrading from
214
221
* previous Enterprise edition?
215
222
*/
216
- invalidate_spgist_indexes (& new_cluster , false);
223
+ if (!same_version_edition (old_cluster , new_cluster ))
224
+ invalidate_spgist_indexes (& new_cluster , false);
217
225
218
- if (GET_MAJOR_VERSION (old_cluster .major_version ) <= 1000
226
+ if (( GET_MAJOR_VERSION (old_cluster .major_version ) <= 1000
219
227
&& old_cluster .edition == PGPRO_ENTERPRISE )
228
+ && !same_version_edition (old_cluster , new_cluster ))
220
229
invalidate_brin_indexes (& new_cluster , false);
221
230
222
231
/*
223
232
* Invalidate external indexes
224
233
*/
225
- invalidate_external_indexes (& new_cluster , false);
234
+ if (!same_version_edition (old_cluster , new_cluster ))
235
+ invalidate_external_indexes (& new_cluster , false);
226
236
227
237
if (old_cluster .edition != PG_ORIGINAL &&
228
238
GET_MAJOR_VERSION (old_cluster .major_version ) <= 906 )
0 commit comments