DEV Community

Discussion on: Row Level Security with an ARRAY of tenants set in session parameter (RLS)

Collapse
 
ramnath profile image
Con • Edited

Hi Franck,
We do use rls in our projects. We use similar type of rls in our project both in oracle and postgres. What I observed is that oracle is more advanced to PostgreSQL in Row level security area. For example, In our projects some times we want to by-pass the policies and return the all the data in the table. In this case, I think with above method by-passing rls is not possible in Postgres. Is there way we can by-pass the rls to return all the rows using above approach?

Thanks,
Ramnath

Collapse
 
franckpachot profile image
Franck Pachot

The ways I know to bypass RLS in general are: connect with the owner, or with a user with BYPASSRLS. For a single user with the same user that is used for RLS, you can also create a view on the table and grant it for select. Then reading from the view will not apply the RLS.