summaryrefslogtreecommitdiff
path: root/src/backend/access/spgist
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-27 18:54:09 +0300
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2015-07-27 18:54:36 +0300
commit0abe9554fc793f05d5c7f18b4b6682d9f1154922 (patch)
treeb341ef77dae4f011c8cc3674053417e2ab0556bd /src/backend/access/spgist
parent7658368cfd5b5a010e57f8eec6cc4c6e19ee635b (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.
Diffstat (limited to 'src/backend/access/spgist')
-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 5b457f67945..7092647c039 100644
--- a/src/backend/access/spgist/spgvacuum.c
+++ b/src/backend/access/spgist/spgvacuum.c
@@ -656,7 +656,7 @@ spgvacuumpage(spgBulkDeleteState *bds, BlockNumber blkno)
*/
if (!SpGistBlockIsRoot(blkno))
{
- if (PageIsEmpty(page))
+ if (PageIsNew(page) || PageIsEmpty(page))
{
RecordFreeIndexPage(index, blkno);
bds->stats->pages_deleted++;