diff options
Diffstat (limited to 'src/backend/commands/policy.c')
-rw-r--r-- | src/backend/commands/policy.c | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/backend/commands/policy.c b/src/backend/commands/policy.c index d98da0dd506..e86299781f9 100644 --- a/src/backend/commands/policy.c +++ b/src/backend/commands/policy.c @@ -460,7 +460,7 @@ RemovePolicyById(Oid policy_id) * * stmt - the CreatePolicyStmt that describes the policy to create. */ -Oid +ObjectAddress CreatePolicy(CreatePolicyStmt *stmt) { Relation pg_policy_rel; @@ -626,7 +626,7 @@ CreatePolicy(CreatePolicyStmt *stmt) relation_close(target_table, NoLock); heap_close(pg_policy_rel, RowExclusiveLock); - return policy_id; + return myself; } /* @@ -635,7 +635,7 @@ CreatePolicy(CreatePolicyStmt *stmt) * * stmt - the AlterPolicyStmt that describes the policy and how to alter it. */ -Oid +ObjectAddress AlterPolicy(AlterPolicyStmt *stmt) { Relation pg_policy_rel; @@ -830,14 +830,14 @@ AlterPolicy(AlterPolicyStmt *stmt) relation_close(target_table, NoLock); heap_close(pg_policy_rel, RowExclusiveLock); - return policy_id; + return myself; } /* * rename_policy - * change the name of a policy on a relation */ -Oid +ObjectAddress rename_policy(RenameStmt *stmt) { Relation pg_policy_rel; @@ -847,6 +847,7 @@ rename_policy(RenameStmt *stmt) ScanKeyData skey[2]; SysScanDesc sscan; HeapTuple policy_tuple; + ObjectAddress address; /* Get id of table. Also handles permissions checks. */ table_id = RangeVarGetRelidExtended(stmt->relation, AccessExclusiveLock, @@ -925,6 +926,8 @@ rename_policy(RenameStmt *stmt) InvokeObjectPostAlterHook(PolicyRelationId, HeapTupleGetOid(policy_tuple), 0); + ObjectAddressSet(address, PolicyRelationId, opoloid); + /* * Invalidate relation's relcache entry so that other backends (and * this one too!) are sent SI message to make them rebuild relcache @@ -937,7 +940,7 @@ rename_policy(RenameStmt *stmt) heap_close(pg_policy_rel, RowExclusiveLock); relation_close(target_table, NoLock); - return opoloid; + return address; } /* |