Documentation / Extension Hooks / Permissions and object access
object_access_hook_str
object_access_hook_str
object_access_hook_str: core extension hook declared in src/include/catalog/objectaccess.h. The exact interface and call sites are recorded below.
Reading PostgreSQL 18.
Description
object_access_hook_str: core extension hook declared in src/include/catalog/objectaccess.h. The exact interface and call sites are recorded below.
- Interface type
- object_access_hook_type_str
- Header
- src/include/catalog/objectaccess.h
- Subsystem
- Permissions and object access
- Initial value
- NULL (no hook installed)
C interface
typedef void (*object_access_hook_type_str) (ObjectAccessType access, Oid classId, const char *objectStr, int subId, void *arg);
extern PGDLLIMPORT object_access_hook_type_str object_access_hook_str;Call sites
src/backend/catalog/objectaccess.c:169
src/backend/catalog/objectaccess.c:191
src/backend/catalog/objectaccess.c:207
src/backend/catalog/objectaccess.c:230
src/backend/catalog/objectaccess.c:252
src/backend/catalog/objectaccess.c:270
Core call context: src/backend/catalog/objectaccess.c:163–177
/* caller should check, but just in case... */
Assert(object_access_hook_str != NULL);
memset(&pc_arg, 0, sizeof(ObjectAccessPostCreate));
pc_arg.is_internal = is_internal;
(*object_access_hook_str) (OAT_POST_CREATE,
classId, objectName, subId,
&pc_arg);
}
/*
* RunObjectDropHookStr
*
* OAT_DROP object name based event hook entrypointCore call context: src/backend/catalog/objectaccess.c:185–199
/* caller should check, but just in case... */
Assert(object_access_hook_str != NULL);
memset(&drop_arg, 0, sizeof(ObjectAccessDrop));
drop_arg.dropflags = dropflags;
(*object_access_hook_str) (OAT_DROP,
classId, objectName, subId,
&drop_arg);
}
/*
* RunObjectTruncateHookStr
*
* OAT_TRUNCATE object name based event hook entrypointCore call context: src/backend/catalog/objectaccess.c:201–215
void
RunObjectTruncateHookStr(const char *objectName)
{
/* caller should check, but just in case... */
Assert(object_access_hook_str != NULL);
(*object_access_hook_str) (OAT_TRUNCATE,
RelationRelationId, objectName, 0,
NULL);
}
/*
* RunObjectPostAlterHookStr
*
* OAT_POST_ALTER object name based event hook entrypointDocumentation and source
Source build
- Version
- 18
- Build
- REL_18_STABLE
- Source fingerprint
753057e340da8f22e57c9a409ea7a235fd6a46bd
Related entries
ExecutorCheckPerms_hookExecutorCheckPerms_hookobject_access_hookobject_access_hookrow_security_policy_hook_permissiverow_security_policy_hook_permissiverow_security_policy_hook_restrictiverow_security_policy_hook_restrictive
Back to Extension Hooks · Recorded in PostgreSQL 15 through 20; the first sample is not necessarily its introduction.