1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-02 09:02:37 +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

@ -842,7 +842,7 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
/*
* Fetch the pg_trigger tuple by the Oid of the trigger
*/
tgrel = heap_open(TriggerRelationId, AccessShareLock);
tgrel = table_open(TriggerRelationId, AccessShareLock);
ScanKeyInit(&skey[0],
Anum_pg_trigger_oid,
@ -857,7 +857,7 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
if (!HeapTupleIsValid(ht_trig))
{
systable_endscan(tgscan);
heap_close(tgrel, AccessShareLock);
table_close(tgrel, AccessShareLock);
return NULL;
}
@ -1078,7 +1078,7 @@ pg_get_triggerdef_worker(Oid trigid, bool pretty)
/* Clean up */
systable_endscan(tgscan);
heap_close(tgrel, AccessShareLock);
table_close(tgrel, AccessShareLock);
return buf.data;
}
@ -1882,7 +1882,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
SysScanDesc scandesc;
ScanKeyData scankey[1];
Snapshot snapshot = RegisterSnapshot(GetTransactionSnapshot());
Relation relation = heap_open(ConstraintRelationId, AccessShareLock);
Relation relation = table_open(ConstraintRelationId, AccessShareLock);
ScanKeyInit(&scankey[0],
Anum_pg_constraint_oid,
@ -1909,7 +1909,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
if (missing_ok)
{
systable_endscan(scandesc);
heap_close(relation, AccessShareLock);
table_close(relation, AccessShareLock);
return NULL;
}
elog(ERROR, "could not find tuple for constraint %u", constraintId);
@ -2260,7 +2260,7 @@ pg_get_constraintdef_worker(Oid constraintId, bool fullCommand,
/* Cleanup */
systable_endscan(scandesc);
heap_close(relation, AccessShareLock);
table_close(relation, AccessShareLock);
return buf.data;
}
@ -2471,7 +2471,7 @@ pg_get_serial_sequence(PG_FUNCTION_ARGS)
column, tablerv->relname)));
/* Search the dependency table for the dependent sequence */
depRel = heap_open(DependRelationId, AccessShareLock);
depRel = table_open(DependRelationId, AccessShareLock);
ScanKeyInit(&key[0],
Anum_pg_depend_refclassid,
@ -2510,7 +2510,7 @@ pg_get_serial_sequence(PG_FUNCTION_ARGS)
}
systable_endscan(scan);
heap_close(depRel, AccessShareLock);
table_close(depRel, AccessShareLock);
if (OidIsValid(sequenceId))
{
@ -4790,7 +4790,7 @@ make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
if (ev_action != NULL)
actions = (List *) stringToNode(ev_action);
ev_relation = heap_open(ev_class, AccessShareLock);
ev_relation = table_open(ev_class, AccessShareLock);
/*
* Build the rules definition text
@ -4924,7 +4924,7 @@ make_ruledef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
appendStringInfoChar(buf, ';');
}
heap_close(ev_relation, AccessShareLock);
table_close(ev_relation, AccessShareLock);
}
@ -4991,13 +4991,13 @@ make_viewdef(StringInfo buf, HeapTuple ruletup, TupleDesc rulettc,
return;
}
ev_relation = heap_open(ev_class, AccessShareLock);
ev_relation = table_open(ev_class, AccessShareLock);
get_query_def(query, buf, NIL, RelationGetDescr(ev_relation),
prettyFlags, wrapColumn, 0);
appendStringInfoChar(buf, ';');
heap_close(ev_relation, AccessShareLock);
table_close(ev_relation, AccessShareLock);
}