Skip to content

Commit 0e98ad0

Browse files
committed
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.
1 parent 746e7f1 commit 0e98ad0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/access/spgist/spgvacuum.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -652,7 +652,7 @@ spgvacuumpage(spgBulkDeleteState *bds, BlockNumber blkno)
652652
*/
653653
if (!SpGistBlockIsRoot(blkno))
654654
{
655-
if (PageIsEmpty(page))
655+
if (PageIsNew(page) || PageIsEmpty(page))
656656
{
657657
RecordFreeIndexPage(index, blkno);
658658
bds->stats->pages_deleted++;

0 commit comments

Comments
 (0)