PostgreSQL Source Code  git master
objectaccess.c File Reference
#include "postgres.h"
#include "catalog/objectaccess.h"
#include "catalog/pg_class.h"
#include "catalog/pg_namespace.h"
#include "catalog/pg_proc.h"
Include dependency graph for objectaccess.c:

Go to the source code of this file.

Functions

void RunObjectPostCreateHook (Oid classId, Oid objectId, int subId, bool is_internal)
 
void RunObjectDropHook (Oid classId, Oid objectId, int subId, int dropflags)
 
void RunObjectTruncateHook (Oid objectId)
 
void RunObjectPostAlterHook (Oid classId, Oid objectId, int subId, Oid auxiliaryId, bool is_internal)
 
bool RunNamespaceSearchHook (Oid objectId, bool ereport_on_violation)
 
void RunFunctionExecuteHook (Oid objectId)
 

Variables

object_access_hook_type object_access_hook = NULL
 

Function Documentation

◆ RunFunctionExecuteHook()

void RunFunctionExecuteHook ( Oid  objectId)

Definition at line 137 of file objectaccess.c.

References Assert, OAT_FUNCTION_EXECUTE, and object_access_hook.

138 {
139  /* caller should check, but just in case... */
140  Assert(object_access_hook != NULL);
141 
142  (*object_access_hook) (OAT_FUNCTION_EXECUTE,
143  ProcedureRelationId, objectId, 0,
144  NULL);
145 }
object_access_hook_type object_access_hook
Definition: objectaccess.c:22
#define Assert(condition)
Definition: c.h:745

◆ RunNamespaceSearchHook()

bool RunNamespaceSearchHook ( Oid  objectId,
bool  ereport_on_violation 
)

Definition at line 113 of file objectaccess.c.

References Assert, ObjectAccessNamespaceSearch::ereport_on_violation, OAT_NAMESPACE_SEARCH, object_access_hook, and ObjectAccessNamespaceSearch::result.

114 {
116 
117  /* caller should check, but just in case... */
118  Assert(object_access_hook != NULL);
119 
120  memset(&ns_arg, 0, sizeof(ObjectAccessNamespaceSearch));
121  ns_arg.ereport_on_violation = ereport_on_violation;
122  ns_arg.result = true;
123 
124  (*object_access_hook) (OAT_NAMESPACE_SEARCH,
125  NamespaceRelationId, objectId, 0,
126  (void *) &ns_arg);
127 
128  return ns_arg.result;
129 }
object_access_hook_type object_access_hook
Definition: objectaccess.c:22
#define Assert(condition)
Definition: c.h:745

◆ RunObjectDropHook()

void RunObjectDropHook ( Oid  classId,
Oid  objectId,
int  subId,
int  dropflags 
)

Definition at line 52 of file objectaccess.c.

References Assert, ObjectAccessDrop::dropflags, OAT_DROP, and object_access_hook.

54 {
55  ObjectAccessDrop drop_arg;
56 
57  /* caller should check, but just in case... */
58  Assert(object_access_hook != NULL);
59 
60  memset(&drop_arg, 0, sizeof(ObjectAccessDrop));
61  drop_arg.dropflags = dropflags;
62 
63  (*object_access_hook) (OAT_DROP,
64  classId, objectId, subId,
65  (void *) &drop_arg);
66 }
object_access_hook_type object_access_hook
Definition: objectaccess.c:22
#define Assert(condition)
Definition: c.h:745

◆ RunObjectPostAlterHook()

void RunObjectPostAlterHook ( Oid  classId,
Oid  objectId,
int  subId,
Oid  auxiliaryId,
bool  is_internal 
)

Definition at line 90 of file objectaccess.c.

References Assert, ObjectAccessPostAlter::auxiliary_id, ObjectAccessPostAlter::is_internal, OAT_POST_ALTER, and object_access_hook.

92 {
93  ObjectAccessPostAlter pa_arg;
94 
95  /* caller should check, but just in case... */
96  Assert(object_access_hook != NULL);
97 
98  memset(&pa_arg, 0, sizeof(ObjectAccessPostAlter));
99  pa_arg.auxiliary_id = auxiliaryId;
100  pa_arg.is_internal = is_internal;
101 
102  (*object_access_hook) (OAT_POST_ALTER,
103  classId, objectId, subId,
104  (void *) &pa_arg);
105 }
object_access_hook_type object_access_hook
Definition: objectaccess.c:22
#define Assert(condition)
Definition: c.h:745

◆ RunObjectPostCreateHook()

void RunObjectPostCreateHook ( Oid  classId,
Oid  objectId,
int  subId,
bool  is_internal 
)

Definition at line 30 of file objectaccess.c.

References Assert, ObjectAccessPostCreate::is_internal, OAT_POST_CREATE, and object_access_hook.

32 {
34 
35  /* caller should check, but just in case... */
36  Assert(object_access_hook != NULL);
37 
38  memset(&pc_arg, 0, sizeof(ObjectAccessPostCreate));
39  pc_arg.is_internal = is_internal;
40 
41  (*object_access_hook) (OAT_POST_CREATE,
42  classId, objectId, subId,
43  (void *) &pc_arg);
44 }
object_access_hook_type object_access_hook
Definition: objectaccess.c:22
#define Assert(condition)
Definition: c.h:745

◆ RunObjectTruncateHook()

void RunObjectTruncateHook ( Oid  objectId)

Definition at line 74 of file objectaccess.c.

References Assert, OAT_TRUNCATE, and object_access_hook.

75 {
76  /* caller should check, but just in case... */
77  Assert(object_access_hook != NULL);
78 
79  (*object_access_hook) (OAT_TRUNCATE,
80  RelationRelationId, objectId, 0,
81  NULL);
82 }
object_access_hook_type object_access_hook
Definition: objectaccess.c:22
#define Assert(condition)
Definition: c.h:745

Variable Documentation

◆ object_access_hook