1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

Make RLS work with UPDATE ... WHERE CURRENT OF

UPDATE ... WHERE CURRENT OF would not work in conjunction with
RLS. Arrange to allow the CURRENT OF expression to be pushed down.
Issue noted by Peter Geoghegan. Patch by Dean Rasheed. Back patch
to 9.5 where RLS was introduced.
This commit is contained in:
Joe Conway
2015-07-24 12:55:30 -07:00
parent d9a356ff2e
commit b26e3d660d
4 changed files with 206 additions and 0 deletions

View File

@@ -1492,6 +1492,16 @@ contain_leaked_vars_walker(Node *node, void *context)
}
break;
case T_CurrentOfExpr:
/*
* WHERE CURRENT OF doesn't contain function calls. Moreover, it
* is important that this can be pushed down into a
* security_barrier view, since the planner must always generate
* a TID scan when CURRENT OF is present -- c.f. cost_tidscan.
*/
return false;
default:
/*