1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-17 17:02:08 +03:00

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.
This commit is contained in:
Heikki Linnakangas
2015-07-27 18:54:09 +03:00
parent 746e7f1c18
commit 0e98ad0915

View File

@ -652,7 +652,7 @@ spgvacuumpage(spgBulkDeleteState *bds, BlockNumber blkno)
*/
if (!SpGistBlockIsRoot(blkno))
{
if (PageIsEmpty(page))
if (PageIsNew(page) || PageIsEmpty(page))
{
RecordFreeIndexPage(index, blkno);
bds->stats->pages_deleted++;