aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache/relcache.c
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2014-11-27 01:06:36 -0500
committerStephen Frost <sfrost@snowman.net>2014-11-27 01:15:57 -0500
commit143b39c1855f8a22f474f20354ee5ee5d2f4d266 (patch)
tree3633add36a9bb7a6a035d94077f6245e71f93acd /src/backend/utils/cache/relcache.c
parent1812ee5767a25a36e7002be8a3a032357d3fe4e2 (diff)
downloadpostgresql-143b39c1855f8a22f474f20354ee5ee5d2f4d266.tar.gz
postgresql-143b39c1855f8a22f474f20354ee5ee5d2f4d266.zip
Rename pg_rowsecurity -> pg_policy and other fixes
As pointed out by Robert, we should really have named pg_rowsecurity pg_policy, as the objects stored in that catalog are policies. This patch fixes that and updates the column names to start with 'pol' to match the new catalog name. The security consideration for COPY with row level security, also pointed out by Robert, has also been addressed by remembering and re-checking the OID of the relation initially referenced during COPY processing, to make sure it hasn't changed under us by the time we finish planning out the query which has been built. Robert and Alvaro also commented on missing OCLASS and OBJECT entries for POLICY (formerly ROWSECURITY or POLICY, depending) in various places. This patch fixes that too, which also happens to add the ability to COMMENT on policies. In passing, attempt to improve the consistency of messages, comments, and documentation as well. This removes various incarnations of 'row-security', 'row-level security', 'Row-security', etc, in favor of 'policy', 'row level security' or 'row_security' as appropriate. Happy Thanksgiving!
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r--src/backend/utils/cache/relcache.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index c80ef3c6f89..79244e56865 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -866,7 +866,7 @@ equalPolicy(RowSecurityPolicy *policy1, RowSecurityPolicy *policy2)
if (policy2 == NULL)
return false;
- if (policy1->rsecid != policy2->rsecid)
+ if (policy1->policy_id != policy2->policy_id)
return false;
if (policy1->cmd != policy2->cmd)
return false;
@@ -3439,7 +3439,7 @@ RelationCacheInitializePhase3(void)
* they are not preserved in the cache. Note that we can never NOT
* have a policy while relrowsecurity is true,
* RelationBuildRowSecurity will create a single default-deny policy
- * if there is no policy defined in pg_rowsecurity.
+ * if there is no policy defined in pg_policy.
*/
if (relation->rd_rel->relrowsecurity && relation->rd_rsdesc == NULL)
{