1/* -------------------------------------------------------------------------
4 * functions for object_access_hook on various events
6 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
7 * Portions Copyright (c) 1994, Regents of the University of California
9 * -------------------------------------------------------------------------
19 * Hook on object accesses. This is intended as infrastructure for security
20 * and logging plugins.
27 * RunObjectPostCreateHook
29 * OAT_POST_CREATE object ID based event hook entrypoint
37 /* caller should check, but just in case... */
44 classId, objectId, subId,
51 * OAT_DROP object ID based event hook entrypoint
59 /* caller should check, but just in case... */
66 classId, objectId, subId,
71 * RunObjectTruncateHook
73 * OAT_TRUNCATE object ID based event hook entrypoint
78 /* caller should check, but just in case... */
82 RelationRelationId, objectId, 0,
87 * RunObjectPostAlterHook
89 * OAT_POST_ALTER object ID based event hook entrypoint
93 Oid auxiliaryId,
bool is_internal)
97 /* caller should check, but just in case... */
105 classId, objectId, subId,
110 * RunNamespaceSearchHook
112 * OAT_NAMESPACE_SEARCH object ID based event hook entrypoint
119 /* caller should check, but just in case... */
127 NamespaceRelationId, objectId, 0,
134 * RunFunctionExecuteHook
136 * OAT_FUNCTION_EXECUTE object ID based event hook entrypoint
141 /* caller should check, but just in case... */
145 ProcedureRelationId, objectId, 0,
153 * RunObjectPostCreateHookStr
155 * OAT_POST_CREATE object name based event hook entrypoint
163 /* caller should check, but just in case... */
170 classId, objectName, subId,
175 * RunObjectDropHookStr
177 * OAT_DROP object name based event hook entrypoint
185 /* caller should check, but just in case... */
191 (*object_access_hook_str) (
OAT_DROP,
192 classId, objectName, subId,
197 * RunObjectTruncateHookStr
199 * OAT_TRUNCATE object name based event hook entrypoint
204 /* caller should check, but just in case... */
208 RelationRelationId, objectName, 0,
213 * RunObjectPostAlterHookStr
215 * OAT_POST_ALTER object name based event hook entrypoint
219 Oid auxiliaryId,
bool is_internal)
223 /* caller should check, but just in case... */
231 classId, objectName, subId,
236 * RunNamespaceSearchHookStr
238 * OAT_NAMESPACE_SEARCH object name based event hook entrypoint
245 /* caller should check, but just in case... */
253 NamespaceRelationId, objectName, 0,
260 * RunFunctionExecuteHookStr
262 * OAT_FUNCTION_EXECUTE object name based event hook entrypoint
267 /* caller should check, but just in case... */
271 ProcedureRelationId, objectName, 0,
Assert(PointerIsAligned(start, uint64))
void RunObjectTruncateHookStr(const char *objectName)
void RunFunctionExecuteHookStr(const char *objectName)
void RunObjectDropHook(Oid classId, Oid objectId, int subId, int dropflags)
void RunObjectPostAlterHook(Oid classId, Oid objectId, int subId, Oid auxiliaryId, bool is_internal)
void RunFunctionExecuteHook(Oid objectId)
bool RunNamespaceSearchHook(Oid objectId, bool ereport_on_violation)
void RunObjectPostCreateHookStr(Oid classId, const char *objectName, int subId, bool is_internal)
object_access_hook_type object_access_hook
void RunObjectTruncateHook(Oid objectId)
void RunObjectPostAlterHookStr(Oid classId, const char *objectName, int subId, Oid auxiliaryId, bool is_internal)
void RunObjectPostCreateHook(Oid classId, Oid objectId, int subId, bool is_internal)
void RunObjectDropHookStr(Oid classId, const char *objectName, int subId, int dropflags)
object_access_hook_type_str object_access_hook_str
bool RunNamespaceSearchHookStr(const char *objectName, bool ereport_on_violation)
void(* object_access_hook_type)(ObjectAccessType access, Oid classId, Oid objectId, int subId, void *arg)
void(* object_access_hook_type_str)(ObjectAccessType access, Oid classId, const char *objectStr, int subId, void *arg)
bool ereport_on_violation