PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
objectaccess.c File Reference
#include "postgres.h"
#include "catalog/objectaccess.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 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

void RunFunctionExecuteHook ( Oid  objectId)

Definition at line 120 of file objectaccess.c.

References Assert, NULL, OAT_FUNCTION_EXECUTE, object_access_hook, and ProcedureRelationId.

121 {
122  /* caller should check, but just in case... */
124 
125  (*object_access_hook) (OAT_FUNCTION_EXECUTE,
126  ProcedureRelationId, objectId, 0,
127  NULL);
128 }
#define ProcedureRelationId
Definition: pg_proc.h:33
#define NULL
Definition: c.h:229
object_access_hook_type object_access_hook
Definition: objectaccess.c:21
#define Assert(condition)
Definition: c.h:676
bool RunNamespaceSearchHook ( Oid  objectId,
bool  ereport_on_violation 
)

Definition at line 96 of file objectaccess.c.

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

97 {
99 
100  /* caller should check, but just in case... */
102 
103  memset(&ns_arg, 0, sizeof(ObjectAccessNamespaceSearch));
104  ns_arg.ereport_on_violation = ereport_on_violation;
105  ns_arg.result = true;
106 
107  (*object_access_hook) (OAT_NAMESPACE_SEARCH,
108  NamespaceRelationId, objectId, 0,
109  (void *) &ns_arg);
110 
111  return ns_arg.result;
112 }
#define NamespaceRelationId
Definition: pg_namespace.h:34
#define NULL
Definition: c.h:229
object_access_hook_type object_access_hook
Definition: objectaccess.c:21
#define Assert(condition)
Definition: c.h:676
void RunObjectDropHook ( Oid  classId,
Oid  objectId,
int  subId,
int  dropflags 
)

Definition at line 51 of file objectaccess.c.

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

53 {
54  ObjectAccessDrop drop_arg;
55 
56  /* caller should check, but just in case... */
58 
59  memset(&drop_arg, 0, sizeof(ObjectAccessDrop));
60  drop_arg.dropflags = dropflags;
61 
62  (*object_access_hook) (OAT_DROP,
63  classId, objectId, subId,
64  (void *) &drop_arg);
65 }
#define NULL
Definition: c.h:229
object_access_hook_type object_access_hook
Definition: objectaccess.c:21
#define Assert(condition)
Definition: c.h:676
void RunObjectPostAlterHook ( Oid  classId,
Oid  objectId,
int  subId,
Oid  auxiliaryId,
bool  is_internal 
)

Definition at line 73 of file objectaccess.c.

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

75 {
76  ObjectAccessPostAlter pa_arg;
77 
78  /* caller should check, but just in case... */
80 
81  memset(&pa_arg, 0, sizeof(ObjectAccessPostAlter));
82  pa_arg.auxiliary_id = auxiliaryId;
83  pa_arg.is_internal = is_internal;
84 
85  (*object_access_hook) (OAT_POST_ALTER,
86  classId, objectId, subId,
87  (void *) &pa_arg);
88 }
#define NULL
Definition: c.h:229
object_access_hook_type object_access_hook
Definition: objectaccess.c:21
#define Assert(condition)
Definition: c.h:676
void RunObjectPostCreateHook ( Oid  classId,
Oid  objectId,
int  subId,
bool  is_internal 
)

Definition at line 29 of file objectaccess.c.

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

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

Variable Documentation