Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PG-1036 Invoke previous object access hook #284

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/access/pg_tde_ddl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,24 @@
#include "access/pg_tde_tdemap.h"


static object_access_hook_type old_objectaccess_hook = NULL;
static object_access_hook_type prev_object_access_hook = NULL;
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Renamed it for consistency with prev_shmem_request_hook


static void tdeheap_object_access_hook(ObjectAccessType access, Oid classId,
Oid objectId, int subId, void *arg);

void SetupTdeDDLHooks(void)
{
old_objectaccess_hook = object_access_hook;
prev_object_access_hook = object_access_hook;
object_access_hook = tdeheap_object_access_hook;
}

static void
tdeheap_object_access_hook(ObjectAccessType access, Oid classId, Oid objectId,
int subId, void *arg)
{
if (prev_object_access_hook)
prev_object_access_hook(access, classId, objectId, subId, arg);

Relation rel = NULL;
if (access == OAT_DROP && classId == RelationRelationId)
{
Expand Down
Loading