1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-10 17:42:29 +03:00

Replace uses of heap_open et al with the corresponding table_* function.

Author: Andres Freund
Discussion: https://postgr.es/m/20190111000539.xbv7s6w7ilcvm7dp@alap3.anarazel.de
This commit is contained in:
Andres Freund
2019-01-21 10:32:19 -08:00
parent 111944c5ee
commit e0c4ec0728
114 changed files with 1259 additions and 1259 deletions

View File

@@ -135,7 +135,7 @@ get_subscription_list(void)
StartTransactionCommand();
(void) GetTransactionSnapshot();
rel = heap_open(SubscriptionRelationId, AccessShareLock);
rel = table_open(SubscriptionRelationId, AccessShareLock);
scan = heap_beginscan_catalog(rel, 0, NULL);
while (HeapTupleIsValid(tup = heap_getnext(scan, ForwardScanDirection)))
@@ -165,7 +165,7 @@ get_subscription_list(void)
}
heap_endscan(scan);
heap_close(rel, AccessShareLock);
table_close(rel, AccessShareLock);
CommitTransactionCommand();

View File

@@ -270,7 +270,7 @@ replorigin_create(char *roname)
*/
InitDirtySnapshot(SnapshotDirty);
rel = heap_open(ReplicationOriginRelationId, ExclusiveLock);
rel = table_open(ReplicationOriginRelationId, ExclusiveLock);
for (roident = InvalidOid + 1; roident < PG_UINT16_MAX; roident++)
{
@@ -313,7 +313,7 @@ replorigin_create(char *roname)
}
/* now release lock again, */
heap_close(rel, ExclusiveLock);
table_close(rel, ExclusiveLock);
if (tuple == NULL)
ereport(ERROR,
@@ -343,7 +343,7 @@ replorigin_drop(RepOriginId roident, bool nowait)
* To interlock against concurrent drops, we hold ExclusiveLock on
* pg_replication_origin throughout this function.
*/
rel = heap_open(ReplicationOriginRelationId, ExclusiveLock);
rel = table_open(ReplicationOriginRelationId, ExclusiveLock);
/*
* First, clean up the slot state info, if there is any matching slot.
@@ -419,7 +419,7 @@ restart:
CommandCounterIncrement();
/* now release lock again */
heap_close(rel, ExclusiveLock);
table_close(rel, ExclusiveLock);
}

View File

@@ -254,7 +254,7 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
(errcode(ERRCODE_OBJECT_NOT_IN_PREREQUISITE_STATE),
errmsg("logical replication target relation \"%s.%s\" does not exist",
remoterel->nspname, remoterel->relname)));
entry->localrel = heap_open(relid, NoLock);
entry->localrel = table_open(relid, NoLock);
/* Check for supported relkind. */
CheckSubscriptionRelkind(entry->localrel->rd_rel->relkind,
@@ -350,7 +350,7 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
entry->localreloid = relid;
}
else
entry->localrel = heap_open(entry->localreloid, lockmode);
entry->localrel = table_open(entry->localreloid, lockmode);
if (entry->state != SUBREL_STATE_READY)
entry->state = GetSubscriptionRelState(MySubscription->oid,
@@ -367,7 +367,7 @@ logicalrep_rel_open(LogicalRepRelId remoteid, LOCKMODE lockmode)
void
logicalrep_rel_close(LogicalRepRelMapEntry *rel, LOCKMODE lockmode)
{
heap_close(rel->localrel, lockmode);
table_close(rel->localrel, lockmode);
rel->localrel = NULL;
}

View File

@@ -877,7 +877,7 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
* working and it has to open the relation in RowExclusiveLock
* when remapping remote relation id to local one.
*/
rel = heap_open(MyLogicalRepWorker->relid, RowExclusiveLock);
rel = table_open(MyLogicalRepWorker->relid, RowExclusiveLock);
/*
* Create a temporary slot for the sync process. We do this
@@ -915,7 +915,7 @@ LogicalRepSyncTableStart(XLogRecPtr *origin_startpos)
errdetail("The error was: %s", res->err)));
walrcv_clear_result(res);
heap_close(rel, NoLock);
table_close(rel, NoLock);
/* Make the copy visible. */
CommandCounterIncrement();