Skip to content

Commit

Permalink
PG-1036 Invoke previous object access hook (#284)
Browse files Browse the repository at this point in the history
  • Loading branch information
artemgavrilov authored Sep 19, 2024
1 parent f030366 commit da0a002
Showing 1 changed file with 5 additions and 2 deletions.
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;

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

0 comments on commit da0a002

Please sign in to comment.