Commit efe72a82 authored by Joe Conway's avatar Joe Conway

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.
parent 13d856e1
...@@ -629,6 +629,8 @@ CreatePolicy(CreatePolicyStmt *stmt) ...@@ -629,6 +629,8 @@ CreatePolicy(CreatePolicyStmt *stmt)
SHARED_DEPENDENCY_POLICY); SHARED_DEPENDENCY_POLICY);
} }
InvokeObjectPostCreateHook(PolicyRelationId, policy_id, 0);
/* Invalidate Relation Cache */ /* Invalidate Relation Cache */
CacheInvalidateRelcache(target_table); CacheInvalidateRelcache(target_table);
...@@ -860,6 +862,8 @@ AlterPolicy(AlterPolicyStmt *stmt) ...@@ -860,6 +862,8 @@ AlterPolicy(AlterPolicyStmt *stmt)
SHARED_DEPENDENCY_POLICY); SHARED_DEPENDENCY_POLICY);
} }
InvokeObjectPostAlterHook(PolicyRelationId, policy_id, 0);
heap_freetuple(new_tuple); heap_freetuple(new_tuple);
/* Invalidate Relation Cache */ /* Invalidate Relation Cache */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment