Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit efe72a8

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 13d856e commit efe72a8

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/backend/commands/policy.c

+4
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)