Skip to content

Commit b775d93

Browse files
committed
Fix pgstat_heap() to not be broken by syncscans starting from a block
higher than zero. Same problem as just detected in CREATE INDEX CONCURRENTLY.
1 parent 6666185 commit b775d93

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

contrib/pgstattuple/pgstattuple.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* $PostgreSQL: pgsql/contrib/pgstattuple/pgstattuple.c,v 1.31 2007/10/22 17:29:35 tgl Exp $
2+
* $PostgreSQL: pgsql/contrib/pgstattuple/pgstattuple.c,v 1.32 2008/01/14 02:53:31 tgl Exp $
33
*
44
* Copyright (c) 2001,2002 Tatsuo Ishii
55
*
@@ -255,7 +255,8 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo)
255255
Buffer buffer;
256256
pgstattuple_type stat = {0};
257257

258-
scan = heap_beginscan(rel, SnapshotAny, 0, NULL);
258+
/* Disable syncscan because we assume we scan from block zero upwards */
259+
scan = heap_beginscan_strat(rel, SnapshotAny, 0, NULL, true, false);
259260

260261
nblocks = scan->rs_nblocks; /* # blocks to be scanned */
261262

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy