aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/ruleutils.c
diff options
context:
space:
mode:
authorAndres Freund <andres@anarazel.de>2019-01-21 10:32:19 -0800
committerAndres Freund <andres@anarazel.de>2019-01-21 10:51:37 -0800
commite0c4ec07284db817e1f8d9adfb3fffc952252db0 (patch)
treead56d635b246f6d4d0d7a17b2a4ac797d7227b62 /src/backend/utils/adt/ruleutils.c
parent111944c5ee567f1c45bf0f1ecfdec682af467aa6 (diff)
downloadpostgresql-e0c4ec07284db817e1f8d9adfb3fffc952252db0.tar.gz
postgresql-e0c4ec07284db817e1f8d9adfb3fffc952252db0.zip
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
Diffstat (limited to 'src/backend/utils/adt/ruleutils.c')
-rw-r--r--src/backend/utils/adt/ruleutils.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/backend/utils/adt/ruleutils.c b/src/backend/utils/adt/ruleutils.c
index 97eeabc8f04..2461d7f35ee 100644
--- a/src/backend/utils/adt/ruleutils.c
+++ b/src/backend/utils/adt/ruleutils.c
@@ -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);
}