PostgreSQL Source Code  git master
objectaccess.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  ObjectAccessPostCreate
 
struct  ObjectAccessDrop
 
struct  ObjectAccessPostAlter
 
struct  ObjectAccessNamespaceSearch
 

Macros

#define InvokeObjectPostCreateHook(classId, objectId, subId)   InvokeObjectPostCreateHookArg((classId),(objectId),(subId),false)
 
#define InvokeObjectPostCreateHookArg(classId, objectId, subId, is_internal)
 
#define InvokeObjectDropHook(classId, objectId, subId)   InvokeObjectDropHookArg((classId),(objectId),(subId),0)
 
#define InvokeObjectDropHookArg(classId, objectId, subId, dropflags)
 
#define InvokeObjectTruncateHook(objectId)
 
#define InvokeObjectPostAlterHook(classId, objectId, subId)
 
#define InvokeObjectPostAlterHookArg(classId, objectId, subId, auxiliaryId, is_internal)
 
#define InvokeNamespaceSearchHook(objectId, ereport_on_violation)
 
#define InvokeFunctionExecuteHook(objectId)
 

Typedefs

typedef enum ObjectAccessType ObjectAccessType
 
typedef void(* object_access_hook_type) (ObjectAccessType access, Oid classId, Oid objectId, int subId, void *arg)
 

Enumerations

enum  ObjectAccessType {
  OAT_POST_CREATE, OAT_DROP, OAT_POST_ALTER, OAT_NAMESPACE_SEARCH,
  OAT_FUNCTION_EXECUTE, OAT_TRUNCATE
}
 

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

PGDLLIMPORT object_access_hook_type object_access_hook
 

Macro Definition Documentation

◆ InvokeFunctionExecuteHook

#define InvokeFunctionExecuteHook (   objectId)
Value:
do { \
RunFunctionExecuteHook(objectId); \
} while(0)
PGDLLIMPORT object_access_hook_type object_access_hook
Definition: objectaccess.c:22

Definition at line 191 of file objectaccess.h.

Referenced by call_pltcl_start_proc(), ExecBuildGroupingEqual(), ExecInitAgg(), ExecInitExprRec(), ExecInitFunc(), ExecInitWindowAgg(), ExecuteCallStmt(), HandleFunctionRequest(), init_sexpr(), and initialize_peragg().

◆ InvokeNamespaceSearchHook

#define InvokeNamespaceSearchHook (   objectId,
  ereport_on_violation 
)
Value:
? true \
: RunNamespaceSearchHook((objectId), (ereport_on_violation)))
bool RunNamespaceSearchHook(Oid objectId, bool ereport_on_violation)
Definition: objectaccess.c:113
PGDLLIMPORT object_access_hook_type object_access_hook
Definition: objectaccess.c:22

Definition at line 186 of file objectaccess.h.

Referenced by HandleFunctionRequest(), LookupExplicitNamespace(), LookupNamespaceNoError(), and recomputeNamespacePath().

◆ InvokeObjectDropHook

#define InvokeObjectDropHook (   classId,
  objectId,
  subId 
)    InvokeObjectDropHookArg((classId),(objectId),(subId),0)

Definition at line 160 of file objectaccess.h.

Referenced by dropdb(), DropRole(), DropSubscription(), and DropTableSpace().

◆ InvokeObjectDropHookArg

#define InvokeObjectDropHookArg (   classId,
  objectId,
  subId,
  dropflags 
)
Value:
do { \
RunObjectDropHook((classId),(objectId),(subId), \
(dropflags)); \
} while(0)
PGDLLIMPORT object_access_hook_type object_access_hook
Definition: objectaccess.c:22

Definition at line 162 of file objectaccess.h.

Referenced by deleteOneObject().

◆ InvokeObjectPostAlterHook

#define InvokeObjectPostAlterHook (   classId,
  objectId,
  subId 
)
Value:
InvokeObjectPostAlterHookArg((classId),(objectId),(subId), \
InvalidOid,false)
#define InvokeObjectPostAlterHookArg(classId, objectId, subId, auxiliaryId, is_internal)
Definition: objectaccess.h:178
#define InvalidOid
Definition: postgres_ext.h:36

Definition at line 175 of file objectaccess.h.

Referenced by AlterCollation(), AlterConstraintNamespaces(), AlterDatabase(), AlterDatabaseOwner(), AlterDomainDefault(), AlterDomainNotNull(), AlterDomainValidateConstraint(), AlterEnum(), AlterEventTrigger(), AlterEventTriggerOwner_internal(), AlterExtensionNamespace(), AlterForeignDataWrapper(), AlterForeignDataWrapperOwner_internal(), AlterForeignServer(), AlterForeignServerOwner_internal(), AlterFunction(), AlterObjectNamespace_internal(), AlterObjectOwner_internal(), AlterObjectRename_internal(), AlterOperator(), AlterPolicy(), AlterPublicationOptions(), AlterPublicationOwner_internal(), AlterRelationNamespaceInternal(), AlterRole(), AlterSchemaOwner_internal(), AlterSequence(), AlterStatistics(), AlterSubscription(), AlterSubscriptionOwner_internal(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterTSDictionary(), AlterTypeNamespaceInternal(), AlterTypeOwner_oid(), AlterTypeRecurse(), AlterUserMapping(), ApplyExtensionUpdates(), ATExecAddIdentity(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecChangeOwner(), ATExecDropExpression(), ATExecDropIdentity(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecSetIdentity(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecSetTableSpaceNoStorage(), ATExecValidateConstraint(), EnableDisableRule(), EnableDisableTrigger(), ExecAlterExtensionContentsStmt(), movedb(), RemoveRoleFromObjectPolicy(), rename_policy(), renameatt_internal(), RenameConstraintById(), RenameDatabase(), RenameRewriteRule(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), RenameTypeInternal(), and SetDefaultACL().

◆ InvokeObjectPostAlterHookArg

#define InvokeObjectPostAlterHookArg (   classId,
  objectId,
  subId,
  auxiliaryId,
  is_internal 
)
Value:
do { \
RunObjectPostAlterHook((classId),(objectId),(subId), \
(auxiliaryId),(is_internal)); \
} while(0)
PGDLLIMPORT object_access_hook_type object_access_hook
Definition: objectaccess.c:22

Definition at line 178 of file objectaccess.h.

Referenced by AlterSetting(), ATExecSetRelOptions(), index_constraint_create(), mark_index_clustered(), relation_mark_replica_identity(), RemoveInheritance(), RenameRelationInternal(), StoreCatalogInheritance1(), and swap_relation_files().

◆ InvokeObjectPostCreateHook

◆ InvokeObjectPostCreateHookArg

#define InvokeObjectPostCreateHookArg (   classId,
  objectId,
  subId,
  is_internal 
)
Value:
do { \
RunObjectPostCreateHook((classId),(objectId),(subId), \
(is_internal)); \
} while(0)
PGDLLIMPORT object_access_hook_type object_access_hook
Definition: objectaccess.c:22

Definition at line 153 of file objectaccess.h.

Referenced by CreateConstraintEntry(), CreateTrigger(), heap_create_with_catalog(), index_create(), and StoreAttrDefault().

◆ InvokeObjectTruncateHook

#define InvokeObjectTruncateHook (   objectId)
Value:
do { \
RunObjectTruncateHook(objectId); \
} while(0)
PGDLLIMPORT object_access_hook_type object_access_hook
Definition: objectaccess.c:22

Definition at line 169 of file objectaccess.h.

Referenced by truncate_check_rel().

Typedef Documentation

◆ object_access_hook_type

typedef void(* object_access_hook_type) (ObjectAccessType access, Oid classId, Oid objectId, int subId, void *arg)

Definition at line 125 of file objectaccess.h.

◆ ObjectAccessType

Enumeration Type Documentation

◆ ObjectAccessType

Enumerator
OAT_POST_CREATE 
OAT_DROP 
OAT_POST_ALTER 
OAT_NAMESPACE_SEARCH 
OAT_FUNCTION_EXECUTE 
OAT_TRUNCATE 

Definition at line 46 of file objectaccess.h.

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