PostgreSQL Source Code  git master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
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 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
}
 

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_volation)
 
void RunFunctionExecuteHook (Oid objectId)
 

Variables

PGDLLIMPORT object_access_hook_type object_access_hook
 

Macro Definition Documentation

#define InvokeFunctionExecuteHook (   objectId)
Value:
do { \
} while(0)
void RunFunctionExecuteHook(Oid objectId)
Definition: objectaccess.c:120
PGDLLIMPORT object_access_hook_type object_access_hook
Definition: objectaccess.c:21

Definition at line 179 of file objectaccess.h.

Referenced by ExecEvalArrayCoerceExpr(), ExecInitAgg(), ExecInitWindowAgg(), HandleFunctionRequest(), init_fcache(), and initialize_peragg().

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

Definition at line 174 of file objectaccess.h.

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

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

Definition at line 154 of file objectaccess.h.

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

#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:21
void RunObjectDropHook(Oid classId, Oid objectId, int subId, int dropflags)
Definition: objectaccess.c:51

Definition at line 156 of file objectaccess.h.

Referenced by deleteOneObject().

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

Definition at line 163 of file objectaccess.h.

Referenced by 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(), AlterSubscription(), AlterSubscriptionOwner_internal(), AlterTableSpaceOptions(), AlterTSConfiguration(), AlterTSDictionary(), AlterTypeNamespaceInternal(), AlterTypeOwner_oid(), ApplyExtensionUpdates(), ATExecAddOf(), ATExecAlterColumnGenericOptions(), ATExecAlterColumnType(), ATExecAlterConstraint(), ATExecChangeOwner(), ATExecDropNotNull(), ATExecDropOf(), ATExecGenericOptions(), ATExecSetNotNull(), ATExecSetOptions(), ATExecSetRelOptions(), ATExecSetStatistics(), ATExecSetStorage(), ATExecSetTableSpace(), ATExecValidateConstraint(), EnableDisableRule(), EnableDisableTrigger(), ExecAlterExtensionContentsStmt(), movedb(), RemoveRoleFromObjectPolicy(), rename_policy(), renameatt_internal(), RenameConstraintById(), RenameDatabase(), RenameRole(), RenameSchema(), RenameTableSpace(), renametrig(), RenameTypeInternal(), and SetDefaultACL().

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

Definition at line 166 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().

#define InvokeObjectPostCreateHookArg (   classId,
  objectId,
  subId,
  is_internal 
)
Value:
do { \
RunObjectPostCreateHook((classId),(objectId),(subId), \
(is_internal)); \
} while(0)
void RunObjectPostCreateHook(Oid classId, Oid objectId, int subId, bool is_internal)
Definition: objectaccess.c:29
PGDLLIMPORT object_access_hook_type object_access_hook
Definition: objectaccess.c:21

Definition at line 147 of file objectaccess.h.

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

Typedef Documentation

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

Definition at line 120 of file objectaccess.h.

Enumeration Type Documentation

Enumerator
OAT_POST_CREATE 
OAT_DROP 
OAT_POST_ALTER 
OAT_NAMESPACE_SEARCH 
OAT_FUNCTION_EXECUTE 

Definition at line 42 of file objectaccess.h.

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:226
object_access_hook_type object_access_hook
Definition: objectaccess.c:21
#define Assert(condition)
Definition: c.h:671
bool RunNamespaceSearchHook ( Oid  objectId,
bool  ereport_on_volation 
)

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:226
object_access_hook_type object_access_hook
Definition: objectaccess.c:21
#define Assert(condition)
Definition: c.h:671
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:226
object_access_hook_type object_access_hook
Definition: objectaccess.c:21
#define Assert(condition)
Definition: c.h:671
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:226
object_access_hook_type object_access_hook
Definition: objectaccess.c:21
#define Assert(condition)
Definition: c.h:671
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:226
object_access_hook_type object_access_hook
Definition: objectaccess.c:21
#define Assert(condition)
Definition: c.h:671

Variable Documentation