]> granicus.if.org Git - postgresql/commitdiff
Add missing post create and alter hooks to policy objects.
authorJoe Conway <mail@joeconway.com>
Wed, 29 Jul 2015 16:47:49 +0000 (09:47 -0700)
committerJoe Conway <mail@joeconway.com>
Wed, 29 Jul 2015 16:47:49 +0000 (09:47 -0700)
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.

src/backend/commands/policy.c

index 4642d7c6403dfcba6b798cc9a873d22e5cb837ca..d8b43908ec406f0bea63dd3f6ca406caf13e2e6c 100644 (file)
@@ -629,6 +629,8 @@ CreatePolicy(CreatePolicyStmt *stmt)
                                                                         SHARED_DEPENDENCY_POLICY);
        }
 
+       InvokeObjectPostCreateHook(PolicyRelationId, policy_id, 0);
+
        /* Invalidate Relation Cache */
        CacheInvalidateRelcache(target_table);
 
@@ -860,6 +862,8 @@ AlterPolicy(AlterPolicyStmt *stmt)
                                                                         SHARED_DEPENDENCY_POLICY);
        }
 
+       InvokeObjectPostAlterHook(PolicyRelationId, policy_id, 0);
+
        heap_freetuple(new_tuple);
 
        /* Invalidate Relation Cache */