aboutsummaryrefslogtreecommitdiff
path: root/src/backend/postmaster/autovacuum.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/postmaster/autovacuum.c')
-rw-r--r--src/backend/postmaster/autovacuum.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/backend/postmaster/autovacuum.c b/src/backend/postmaster/autovacuum.c
index e9fe0a6e1fb..3bfac919c43 100644
--- a/src/backend/postmaster/autovacuum.c
+++ b/src/backend/postmaster/autovacuum.c
@@ -69,6 +69,7 @@
#include "access/htup_details.h"
#include "access/multixact.h"
#include "access/reloptions.h"
+#include "access/tableam.h"
#include "access/transam.h"
#include "access/xact.h"
#include "catalog/dependency.h"
@@ -1865,7 +1866,7 @@ get_database_list(void)
{
List *dblist = NIL;
Relation rel;
- HeapScanDesc scan;
+ TableScanDesc scan;
HeapTuple tup;
MemoryContext resultcxt;
@@ -1883,7 +1884,7 @@ get_database_list(void)
(void) GetTransactionSnapshot();
rel = table_open(DatabaseRelationId, AccessShareLock);
- scan = heap_beginscan_catalog(rel, 0, NULL);
+ scan = table_beginscan_catalog(rel, 0, NULL);
while (HeapTupleIsValid(tup = heap_getnext(scan, ForwardScanDirection)))
{
@@ -1912,7 +1913,7 @@ get_database_list(void)
MemoryContextSwitchTo(oldcxt);
}
- heap_endscan(scan);
+ table_endscan(scan);
table_close(rel, AccessShareLock);
CommitTransactionCommand();
@@ -1931,7 +1932,7 @@ do_autovacuum(void)
{
Relation classRel;
HeapTuple tuple;
- HeapScanDesc relScan;
+ TableScanDesc relScan;
Form_pg_database dbForm;
List *table_oids = NIL;
List *orphan_oids = NIL;
@@ -2043,7 +2044,7 @@ do_autovacuum(void)
* wide tables there might be proportionally much more activity in the
* TOAST table than in its parent.
*/
- relScan = heap_beginscan_catalog(classRel, 0, NULL);
+ relScan = table_beginscan_catalog(classRel, 0, NULL);
/*
* On the first pass, we collect main tables to vacuum, and also the main
@@ -2132,7 +2133,7 @@ do_autovacuum(void)
}
}
- heap_endscan(relScan);
+ table_endscan(relScan);
/* second pass: check TOAST tables */
ScanKeyInit(&key,
@@ -2140,7 +2141,7 @@ do_autovacuum(void)
BTEqualStrategyNumber, F_CHAREQ,
CharGetDatum(RELKIND_TOASTVALUE));
- relScan = heap_beginscan_catalog(classRel, 1, &key);
+ relScan = table_beginscan_catalog(classRel, 1, &key);
while ((tuple = heap_getnext(relScan, ForwardScanDirection)) != NULL)
{
Form_pg_class classForm = (Form_pg_class) GETSTRUCT(tuple);
@@ -2187,7 +2188,7 @@ do_autovacuum(void)
table_oids = lappend_oid(table_oids, relid);
}
- heap_endscan(relScan);
+ table_endscan(relScan);
table_close(classRel, AccessShareLock);
/*