aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Geoghegan <pg@bowt.ie>2021-10-29 10:53:46 -0700
committerPeter Geoghegan <pg@bowt.ie>2021-10-29 10:53:46 -0700
commitbd9f4cf0ee5336ce4f9f3103521740baccfb3825 (patch)
tree997596a2494680faa2d9c9b78e1924862949b2c2
parent0c8a40b391191793afe8f1e202765a5b71bccea5 (diff)
downloadpostgresql-bd9f4cf0ee5336ce4f9f3103521740baccfb3825.tar.gz
postgresql-bd9f4cf0ee5336ce4f9f3103521740baccfb3825.zip
Demote pg_unreachable() in heapam to an assertion.
Commit d168b66682, which overhauled index deletion, added a pg_unreachable() to the end of a sort comparator used when sorting heap TIDs from an index page. This allows the compiler to apply optimizations that assume that the heap TIDs from the index AM must always be unique. That doesn't seem like a good idea now, given recent reports of corruption involving duplicate TIDs in indexes on Postgres 14. Demote to an assertion, just in case. Backpatch: 14-, where index deletion was overhauled.
-rw-r--r--src/backend/access/heap/heapam.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 972fdbcb92f..5945559a1e3 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -7579,7 +7579,7 @@ index_delete_sort_cmp(TM_IndexDelete *deltid1, TM_IndexDelete *deltid2)
return (pos1 < pos2) ? -1 : 1;
}
- pg_unreachable();
+ Assert(false);
return 0;
}