Skip to content

Commit 0bfbf14

Browse files
committed
Add missing post create and alter hooks to policy objects.
AlterPolicy() and CreatePolicy() lacked their respective hook invocations. Noted by Noah Misch, review by Dean Rasheed. Back-patch to 9.5 where RLS was introduced.
1 parent 81191f6 commit 0bfbf14

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/commands/policy.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -629,6 +629,8 @@ CreatePolicy(CreatePolicyStmt *stmt)
629629
SHARED_DEPENDENCY_POLICY);
630630
}
631631

632+
InvokeObjectPostCreateHook(PolicyRelationId, policy_id, 0);
633+
632634
/* Invalidate Relation Cache */
633635
CacheInvalidateRelcache(target_table);
634636

@@ -860,6 +862,8 @@ AlterPolicy(AlterPolicyStmt *stmt)
860862
SHARED_DEPENDENCY_POLICY);
861863
}
862864

865+
InvokeObjectPostAlterHook(PolicyRelationId, policy_id, 0);
866+
863867
heap_freetuple(new_tuple);
864868

865869
/* Invalidate Relation Cache */

0 commit comments

Comments
 (0)