1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-13 07:41:39 +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

@ -390,7 +390,7 @@ insert_event_trigger_tuple(const char *trigname, const char *eventname, Oid evtO
referenced;
/* Open pg_event_trigger. */
tgrel = heap_open(EventTriggerRelationId, RowExclusiveLock);
tgrel = table_open(EventTriggerRelationId, RowExclusiveLock);
/* Build the new pg_trigger tuple. */
trigoid = GetNewOidWithIndex(tgrel, EventTriggerOidIndexId,
@ -435,7 +435,7 @@ insert_event_trigger_tuple(const char *trigname, const char *eventname, Oid evtO
InvokeObjectPostCreateHook(EventTriggerRelationId, trigoid, 0);
/* Close pg_event_trigger. */
heap_close(tgrel, RowExclusiveLock);
table_close(tgrel, RowExclusiveLock);
return trigoid;
}
@ -486,7 +486,7 @@ RemoveEventTriggerById(Oid trigOid)
Relation tgrel;
HeapTuple tup;
tgrel = heap_open(EventTriggerRelationId, RowExclusiveLock);
tgrel = table_open(EventTriggerRelationId, RowExclusiveLock);
tup = SearchSysCache1(EVENTTRIGGEROID, ObjectIdGetDatum(trigOid));
if (!HeapTupleIsValid(tup))
@ -496,7 +496,7 @@ RemoveEventTriggerById(Oid trigOid)
ReleaseSysCache(tup);
heap_close(tgrel, RowExclusiveLock);
table_close(tgrel, RowExclusiveLock);
}
/*
@ -511,7 +511,7 @@ AlterEventTrigger(AlterEventTrigStmt *stmt)
Form_pg_event_trigger evtForm;
char tgenabled = stmt->tgenabled;
tgrel = heap_open(EventTriggerRelationId, RowExclusiveLock);
tgrel = table_open(EventTriggerRelationId, RowExclusiveLock);
tup = SearchSysCacheCopy1(EVENTTRIGGERNAME,
CStringGetDatum(stmt->trigname));
@ -538,7 +538,7 @@ AlterEventTrigger(AlterEventTrigStmt *stmt)
/* clean up */
heap_freetuple(tup);
heap_close(tgrel, RowExclusiveLock);
table_close(tgrel, RowExclusiveLock);
return trigoid;
}
@ -555,7 +555,7 @@ AlterEventTriggerOwner(const char *name, Oid newOwnerId)
Relation rel;
ObjectAddress address;
rel = heap_open(EventTriggerRelationId, RowExclusiveLock);
rel = table_open(EventTriggerRelationId, RowExclusiveLock);
tup = SearchSysCacheCopy1(EVENTTRIGGERNAME, CStringGetDatum(name));
@ -573,7 +573,7 @@ AlterEventTriggerOwner(const char *name, Oid newOwnerId)
heap_freetuple(tup);
heap_close(rel, RowExclusiveLock);
table_close(rel, RowExclusiveLock);
return address;
}
@ -587,7 +587,7 @@ AlterEventTriggerOwner_oid(Oid trigOid, Oid newOwnerId)
HeapTuple tup;
Relation rel;
rel = heap_open(EventTriggerRelationId, RowExclusiveLock);
rel = table_open(EventTriggerRelationId, RowExclusiveLock);
tup = SearchSysCacheCopy1(EVENTTRIGGEROID, ObjectIdGetDatum(trigOid));
@ -600,7 +600,7 @@ AlterEventTriggerOwner_oid(Oid trigOid, Oid newOwnerId)
heap_freetuple(tup);
heap_close(rel, RowExclusiveLock);
table_close(rel, RowExclusiveLock);
}
/*
@ -1364,7 +1364,7 @@ EventTriggerSQLDropAddObject(const ObjectAddress *object, bool original, bool no
Relation catalog;
HeapTuple tuple;
catalog = heap_open(obj->address.classId, AccessShareLock);
catalog = table_open(obj->address.classId, AccessShareLock);
tuple = get_catalog_object_by_oid(catalog,
get_object_attnum_oid(object->classId),
obj->address.objectId);
@ -1394,7 +1394,7 @@ EventTriggerSQLDropAddObject(const ObjectAddress *object, bool original, bool no
else if (isAnyTempNamespace(namespaceId))
{
pfree(obj);
heap_close(catalog, AccessShareLock);
table_close(catalog, AccessShareLock);
MemoryContextSwitchTo(oldcxt);
return;
}
@ -1420,7 +1420,7 @@ EventTriggerSQLDropAddObject(const ObjectAddress *object, bool original, bool no
}
}
heap_close(catalog, AccessShareLock);
table_close(catalog, AccessShareLock);
}
else
{
@ -2114,7 +2114,7 @@ pg_event_trigger_ddl_commands(PG_FUNCTION_ARGS)
Oid schema_oid;
bool isnull;
catalog = heap_open(addr.classId, AccessShareLock);
catalog = table_open(addr.classId, AccessShareLock);
objtup = get_catalog_object_by_oid(catalog,
get_object_attnum_oid(addr.classId),
addr.objectId);
@ -2134,7 +2134,7 @@ pg_event_trigger_ddl_commands(PG_FUNCTION_ARGS)
else
schema = get_namespace_name(schema_oid);
heap_close(catalog, AccessShareLock);
table_close(catalog, AccessShareLock);
}
}