From: Tom Lane Date: Mon, 14 Jan 2008 02:53:31 +0000 (+0000) Subject: Fix pgstat_heap() to not be broken by syncscans starting from a block X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=dbbe96708b9e1d4ad39851fcdf66ac145d6aa451;p=users%2Fbernd%2Fpostgres.git 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. --- diff --git a/contrib/pgstattuple/pgstattuple.c b/contrib/pgstattuple/pgstattuple.c index 176f517c52..0f9de66344 100644 --- a/contrib/pgstattuple/pgstattuple.c +++ b/contrib/pgstattuple/pgstattuple.c @@ -255,7 +255,8 @@ pgstat_heap(Relation rel, FunctionCallInfo fcinfo) Buffer buffer; pgstattuple_type stat = {0}; - scan = heap_beginscan(rel, SnapshotAny, 0, NULL); + /* Disable syncscan because we assume we scan from block zero upwards */ + scan = heap_beginscan_strat(rel, SnapshotAny, 0, NULL, true, false); nblocks = scan->rs_nblocks; /* # blocks to be scanned */