DEV Community

Cover image for Understanding PostgreSQL RLS, and When to Use it

Understanding PostgreSQL RLS, and When to Use it

Michael La Posta on February 05, 2024

Somewhere around 3rd or 4th quarter 2023, I was starting to look into the requirements of a project I needed to start in the new year. I was trying...
Collapse
 
jhelberg_63 profile image
Joost

Rls is extremely important. All these incidents where staff can wrongfully access data because of terminated contracts, moved patients and related people can be prevented with rls. Thanks for the article!

Collapse
 
ldrscke profile image
Christian Ledermann

Another use case would be multi tenant apps, where no tenant should be able to see other tenants data. Having those restrictions on DB level avoids possible security issues in the app layer.

Collapse
 
mlaposta profile image
Michael La Posta

Great example!

Especially with the rise in cloud-based apps these days, that extra layer of security is a definite plus.