summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHeikki Linnakangas2015-07-27 15:54:09 +0000
committerHeikki Linnakangas2015-07-27 15:54:09 +0000
commit820d1ced1b308702b3f811647810b4030f974d89 (patch)
treeb3d26eb27e7b88aaae0fafdefabd8436ad878f59
parent61a65c53bd3e48e7ff7661a528d1791dfd956957 (diff)
Don't assume that PageIsEmpty() returns true on an all-zeros page.
It does currently, and I don't see us changing that any time soon, but we don't make that assumption anywhere else. Per Tom Lane's suggestion. Backpatch to 9.2, like the previous patch that added this assumption.
-rw-r--r--src/backend/access/spgist/spgvacuum.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/access/spgist/spgvacuum.c b/src/backend/access/spgist/spgvacuum.c
index d40da0eecc..06c0b0af7e 100644
--- a/src/backend/access/spgist/spgvacuum.c
+++ b/src/backend/access/spgist/spgvacuum.c
@@ -655,7 +655,7 @@ spgvacuumpage(spgBulkDeleteState *bds, BlockNumber blkno)
*/
if (!SpGistBlockIsRoot(blkno))
{
- if (PageIsEmpty(page))
+ if (PageIsNew(page) || PageIsEmpty(page))
{
RecordFreeIndexPage(index, blkno);
bds->stats->pages_deleted++;