aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access')
-rw-r--r--src/backend/access/brin/brin.c14
-rw-r--r--src/backend/access/heap/heapam.c4
-rw-r--r--src/backend/access/heap/tuptoaster.c24
-rw-r--r--src/backend/access/nbtree/nbtsort.c4
4 files changed, 23 insertions, 23 deletions
diff --git a/src/backend/access/brin/brin.c b/src/backend/access/brin/brin.c
index 34f82d46821..467d91e6818 100644
--- a/src/backend/access/brin/brin.c
+++ b/src/backend/access/brin/brin.c
@@ -390,9 +390,9 @@ bringetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
* iterate on the revmap.
*/
heapOid = IndexGetRelation(RelationGetRelid(idxRel), false);
- heapRel = heap_open(heapOid, AccessShareLock);
+ heapRel = table_open(heapOid, AccessShareLock);
nblocks = RelationGetNumberOfBlocks(heapRel);
- heap_close(heapRel, AccessShareLock);
+ table_close(heapRel, AccessShareLock);
/*
* Make room for the consistent support procedures of indexed columns. We
@@ -799,15 +799,15 @@ brinvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
stats->num_pages = RelationGetNumberOfBlocks(info->index);
/* rest of stats is initialized by zeroing */
- heapRel = heap_open(IndexGetRelation(RelationGetRelid(info->index), false),
- AccessShareLock);
+ heapRel = table_open(IndexGetRelation(RelationGetRelid(info->index), false),
+ AccessShareLock);
brin_vacuum_scan(info->index, info->strategy);
brinsummarize(info->index, heapRel, BRIN_ALL_BLOCKRANGES, false,
&stats->num_index_tuples, &stats->num_index_tuples);
- heap_close(heapRel, AccessShareLock);
+ table_close(heapRel, AccessShareLock);
return stats;
}
@@ -897,7 +897,7 @@ brin_summarize_range(PG_FUNCTION_ARGS)
*/
heapoid = IndexGetRelation(indexoid, true);
if (OidIsValid(heapoid))
- heapRel = heap_open(heapoid, ShareUpdateExclusiveLock);
+ heapRel = table_open(heapoid, ShareUpdateExclusiveLock);
else
heapRel = NULL;
@@ -974,7 +974,7 @@ brin_desummarize_range(PG_FUNCTION_ARGS)
*/
heapoid = IndexGetRelation(indexoid, true);
if (OidIsValid(heapoid))
- heapRel = heap_open(heapoid, ShareUpdateExclusiveLock);
+ heapRel = table_open(heapoid, ShareUpdateExclusiveLock);
else
heapRel = NULL;
diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c
index 6c33aefd855..dc2ff89d270 100644
--- a/src/backend/access/heap/heapam.c
+++ b/src/backend/access/heap/heapam.c
@@ -8990,10 +8990,10 @@ heap_sync(Relation rel)
{
Relation toastrel;
- toastrel = heap_open(rel->rd_rel->reltoastrelid, AccessShareLock);
+ toastrel = table_open(rel->rd_rel->reltoastrelid, AccessShareLock);
FlushRelationBuffers(toastrel);
smgrimmedsync(toastrel->rd_smgr, MAIN_FORKNUM);
- heap_close(toastrel, AccessShareLock);
+ table_close(toastrel, AccessShareLock);
}
}
diff --git a/src/backend/access/heap/tuptoaster.c b/src/backend/access/heap/tuptoaster.c
index 0ffc5392a6d..6763fb920c2 100644
--- a/src/backend/access/heap/tuptoaster.c
+++ b/src/backend/access/heap/tuptoaster.c
@@ -1422,7 +1422,7 @@ toast_get_valid_index(Oid toastoid, LOCKMODE lock)
Relation toastrel;
/* Open the toast relation */
- toastrel = heap_open(toastoid, lock);
+ toastrel = table_open(toastoid, lock);
/* Look for the valid index of the toast relation */
validIndex = toast_open_indexes(toastrel,
@@ -1433,7 +1433,7 @@ toast_get_valid_index(Oid toastoid, LOCKMODE lock)
/* Close the toast relation and all its indexes */
toast_close_indexes(toastidxs, num_indexes, lock);
- heap_close(toastrel, lock);
+ table_close(toastrel, lock);
return validIndexOid;
}
@@ -1487,7 +1487,7 @@ toast_save_datum(Relation rel, Datum value,
* uniqueness of the OID we assign to the toasted item, even though it has
* additional columns besides OID.
*/
- toastrel = heap_open(rel->rd_rel->reltoastrelid, RowExclusiveLock);
+ toastrel = table_open(rel->rd_rel->reltoastrelid, RowExclusiveLock);
toasttupDesc = toastrel->rd_att;
/* Open all the toast indexes and look for the valid one */
@@ -1692,7 +1692,7 @@ toast_save_datum(Relation rel, Datum value,
* Done - close toast relation and its indexes
*/
toast_close_indexes(toastidxs, num_indexes, RowExclusiveLock);
- heap_close(toastrel, RowExclusiveLock);
+ table_close(toastrel, RowExclusiveLock);
/*
* Create the TOAST pointer value that we'll return
@@ -1734,7 +1734,7 @@ toast_delete_datum(Relation rel, Datum value, bool is_speculative)
/*
* Open the toast relation and its indexes
*/
- toastrel = heap_open(toast_pointer.va_toastrelid, RowExclusiveLock);
+ toastrel = table_open(toast_pointer.va_toastrelid, RowExclusiveLock);
/* Fetch valid relation used for process */
validIndex = toast_open_indexes(toastrel,
@@ -1774,7 +1774,7 @@ toast_delete_datum(Relation rel, Datum value, bool is_speculative)
*/
systable_endscan_ordered(toastscan);
toast_close_indexes(toastidxs, num_indexes, RowExclusiveLock);
- heap_close(toastrel, RowExclusiveLock);
+ table_close(toastrel, RowExclusiveLock);
}
@@ -1840,11 +1840,11 @@ toastid_valueid_exists(Oid toastrelid, Oid valueid)
bool result;
Relation toastrel;
- toastrel = heap_open(toastrelid, AccessShareLock);
+ toastrel = table_open(toastrelid, AccessShareLock);
result = toastrel_valueid_exists(toastrel, valueid);
- heap_close(toastrel, AccessShareLock);
+ table_close(toastrel, AccessShareLock);
return result;
}
@@ -1899,7 +1899,7 @@ toast_fetch_datum(struct varlena *attr)
/*
* Open the toast relation and its indexes
*/
- toastrel = heap_open(toast_pointer.va_toastrelid, AccessShareLock);
+ toastrel = table_open(toast_pointer.va_toastrelid, AccessShareLock);
toasttupDesc = toastrel->rd_att;
/* Look for the valid index of the toast relation */
@@ -2016,7 +2016,7 @@ toast_fetch_datum(struct varlena *attr)
*/
systable_endscan_ordered(toastscan);
toast_close_indexes(toastidxs, num_indexes, AccessShareLock);
- heap_close(toastrel, AccessShareLock);
+ table_close(toastrel, AccessShareLock);
return result;
}
@@ -2102,7 +2102,7 @@ toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset, int32 length)
/*
* Open the toast relation and its indexes
*/
- toastrel = heap_open(toast_pointer.va_toastrelid, AccessShareLock);
+ toastrel = table_open(toast_pointer.va_toastrelid, AccessShareLock);
toasttupDesc = toastrel->rd_att;
/* Look for the valid index of toast relation */
@@ -2249,7 +2249,7 @@ toast_fetch_datum_slice(struct varlena *attr, int32 sliceoffset, int32 length)
*/
systable_endscan_ordered(toastscan);
toast_close_indexes(toastidxs, num_indexes, AccessShareLock);
- heap_close(toastrel, AccessShareLock);
+ table_close(toastrel, AccessShareLock);
return result;
}
diff --git a/src/backend/access/nbtree/nbtsort.c b/src/backend/access/nbtree/nbtsort.c
index 5cc3cf57e22..dc398e11867 100644
--- a/src/backend/access/nbtree/nbtsort.c
+++ b/src/backend/access/nbtree/nbtsort.c
@@ -1550,7 +1550,7 @@ _bt_parallel_build_main(dsm_segment *seg, shm_toc *toc)
}
/* Open relations within worker */
- heapRel = heap_open(btshared->heaprelid, heapLockmode);
+ heapRel = table_open(btshared->heaprelid, heapLockmode);
indexRel = index_open(btshared->indexrelid, indexLockmode);
/* Initialize worker's own spool */
@@ -1595,7 +1595,7 @@ _bt_parallel_build_main(dsm_segment *seg, shm_toc *toc)
#endif /* BTREE_BUILD_STATS */
index_close(indexRel, indexLockmode);
- heap_close(heapRel, heapLockmode);
+ table_close(heapRel, heapLockmode);
}
/*