|
31 | 31 | #include "access/xact.h"
|
32 | 32 | #include "catalog/index.h"
|
33 | 33 | #include "catalog/pg_am.h"
|
| 34 | +#include "catalog/pg_opfamily_d.h" |
34 | 35 | #include "commands/tablecmds.h"
|
35 | 36 | #include "common/pg_prng.h"
|
36 | 37 | #include "lib/bloomfilter.h"
|
@@ -338,10 +339,20 @@ bt_index_check_internal(Oid indrelid, bool parentcheck, bool heapallindexed,
|
338 | 339 | errmsg("index \"%s\" metapage has equalimage field set on unsupported nbtree version",
|
339 | 340 | RelationGetRelationName(indrel))));
|
340 | 341 | if (allequalimage && !_bt_allequalimage(indrel, false))
|
| 342 | + { |
| 343 | + bool has_interval_ops = false; |
| 344 | + |
| 345 | + for (int i = 0; i < IndexRelationGetNumberOfKeyAttributes(indrel); i++) |
| 346 | + if (indrel->rd_opfamily[i] == INTERVAL_BTREE_FAM_OID) |
| 347 | + has_interval_ops = true; |
341 | 348 | ereport(ERROR,
|
342 | 349 | (errcode(ERRCODE_INDEX_CORRUPTED),
|
343 | 350 | errmsg("index \"%s\" metapage incorrectly indicates that deduplication is safe",
|
344 |
| - RelationGetRelationName(indrel)))); |
| 351 | + RelationGetRelationName(indrel)), |
| 352 | + has_interval_ops |
| 353 | + ? errhint("This is known of \"interval\" indexes last built on a version predating 2023-11.") |
| 354 | + : 0)); |
| 355 | + } |
345 | 356 |
|
346 | 357 | /* Check index, possibly against table it is an index on */
|
347 | 358 | bt_check_every_level(indrel, heaprel, heapkeyspace, parentcheck,
|
|
0 commit comments