aboutsummaryrefslogtreecommitdiff
path: root/src/backend/rewrite/rowsecurity.c
diff options
context:
space:
mode:
authorStephen Frost <sfrost@snowman.net>2014-11-14 16:53:51 -0500
committerStephen Frost <sfrost@snowman.net>2014-11-14 17:05:17 -0500
commit80eacaa3cdcd10383c333f6f4625af8cee1f7bee (patch)
treeadd25b61cd7911e76ca490b9f1eebb4e828178ea /src/backend/rewrite/rowsecurity.c
parent79172a58ea3e858750c93c61d55411a209c5ac69 (diff)
downloadpostgresql-80eacaa3cdcd10383c333f6f4625af8cee1f7bee.tar.gz
postgresql-80eacaa3cdcd10383c333f6f4625af8cee1f7bee.zip
Clean up includes from RLS patch
The initial patch for RLS mistakenly included headers associated with the executor and planner bits in rewrite/rowsecurity.h. Per policy and general good sense, executor headers should not be included in planner headers or vice versa. The include of execnodes.h was a mistaken holdover from previous versions, while the include of relation.h was used for Relation's definition, which should have been coming from utils/relcache.h. This patch cleans these issues up, adds comments to the RowSecurityPolicy struct and the RowSecurityConfigType enum, and changes Relation->rsdesc to Relation->rd_rsdesc to follow Relation field naming convention. Additionally, utils/rel.h was including rewrite/rowsecurity.h, which wasn't a great idea since that was pulling in things not really needed in utils/rel.h (which gets included in quite a few places). Instead, use 'struct RowSecurityDesc' for the rd_rsdesc field and add comments explaining why. Lastly, add an include into access/nbtree/nbtsort.c for utils/sortsupport.h, which was evidently missed due to the above mess. Pointed out by Tom in 16970.1415838651@sss.pgh.pa.us; note that the concerns regarding a similar situation in the custom-path commit still need to be addressed.
Diffstat (limited to 'src/backend/rewrite/rowsecurity.c')
-rw-r--r--src/backend/rewrite/rowsecurity.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/backend/rewrite/rowsecurity.c b/src/backend/rewrite/rowsecurity.c
index bb95b367198..66c358cdec9 100644
--- a/src/backend/rewrite/rowsecurity.c
+++ b/src/backend/rewrite/rowsecurity.c
@@ -300,7 +300,7 @@ pull_row_security_policies(CmdType cmd, Relation relation, Oid user_id)
* There must always be at least one policy defined (may be the simple
* 'default-deny' policy, if none are explicitly defined on the table).
*/
- foreach(item, relation->rsdesc->policies)
+ foreach(item, relation->rd_rsdesc->policies)
{
policy = (RowSecurityPolicy *) lfirst(item);