summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPavan Deolasee2016-10-26 08:09:30 +0000
committerPavan Deolasee2016-10-26 08:09:30 +0000
commit6f9e4f9c7305597ab1d7e831479f1b6a103c01ca (patch)
tree6dce95e6c277623b43fcd0b05cf7d7e56f23d7b9
parent074c2c1bb2605c1f34cf61f29c94cf2a352f6f27 (diff)
Fix a left-over reference from RLS related cherry picks
-rw-r--r--src/backend/rewrite/rowsecurity.c15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/backend/rewrite/rowsecurity.c b/src/backend/rewrite/rowsecurity.c
index 396993c8e7..151484ce92 100644
--- a/src/backend/rewrite/rowsecurity.c
+++ b/src/backend/rewrite/rowsecurity.c
@@ -121,22 +121,13 @@ get_row_security_policies(Query *root, RangeTblEntry *rte, int rt_index,
*hasRowSecurity = false;
*hasSubLinks = false;
- /* This is just to get the security context */
- GetUserIdAndSecContext(&user_id, &sec_context);
+ /* If this is not a normal relation, just return immediately */
+ if (rte->relkind != RELKIND_RELATION)
+ return;
/* Switch to checkAsUser if it's set */
user_id = rte->checkAsUser ? rte->checkAsUser : GetUserId();
- /*
- * If this is not a normal relation, or we have been told to explicitly
- * skip RLS (perhaps because this is an FK check) then just return
- * immediately.
- */
- if (rte->relid < FirstNormalObjectId
- || rte->relkind != RELKIND_RELATION
- || (sec_context & SECURITY_ROW_LEVEL_DISABLED))
- return;
-
/* Determine the state of RLS for this, pass checkAsUser explicitly */
rls_status = check_enable_rls(rte->relid, rte->checkAsUser, false);