Header And Logo

PostgreSQL
| The world's most advanced open source database.

Functions | Variables

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, and object_access_hook.

{
    /* caller should check, but just in case... */
    Assert(object_access_hook != NULL);

    (*object_access_hook)(OAT_FUNCTION_EXECUTE,
                          ProcedureRelationId, objectId, 0,
                          NULL);
}

bool RunNamespaceSearchHook ( Oid  objectId,
bool  ereport_on_violation 
)

Definition at line 96 of file objectaccess.c.

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

{
    ObjectAccessNamespaceSearch ns_arg;

    /* caller should check, but just in case... */
    Assert(object_access_hook != NULL);

    memset(&ns_arg, 0, sizeof(ObjectAccessNamespaceSearch));
    ns_arg.ereport_on_violation = ereport_on_violation;
    ns_arg.result = true;

    (*object_access_hook)(OAT_NAMESPACE_SEARCH,
                          NamespaceRelationId, objectId, 0,
                          (void *) &ns_arg);

    return ns_arg.result;
}

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

Definition at line 51 of file objectaccess.c.

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

{
    ObjectAccessDrop    drop_arg;

    /* caller should check, but just in case... */
    Assert(object_access_hook != NULL);

    memset(&drop_arg, 0, sizeof(ObjectAccessDrop));
    drop_arg.dropflags = dropflags;

    (*object_access_hook)(OAT_DROP,
                          classId, objectId, subId,
                          (void *) &drop_arg);
}

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, and object_access_hook.

{
    ObjectAccessPostAlter   pa_arg;

    /* caller should check, but just in case... */
    Assert(object_access_hook != NULL);

    memset(&pa_arg, 0, sizeof(ObjectAccessPostAlter));
    pa_arg.auxiliary_id = auxiliaryId;
    pa_arg.is_internal = is_internal;

    (*object_access_hook)(OAT_POST_ALTER,
                          classId, objectId, subId,
                          (void *) &pa_arg);
}

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, and object_access_hook.

{
    ObjectAccessPostCreate  pc_arg;

    /* caller should check, but just in case... */
    Assert(object_access_hook != NULL);

    memset(&pc_arg, 0, sizeof(ObjectAccessPostCreate));
    pc_arg.is_internal = is_internal;

    (*object_access_hook)(OAT_POST_CREATE,
                          classId, objectId, subId,
                          (void *) &pc_arg);
}


Variable Documentation