Show HN: Underrated Postgres: Build Multi-Tenancy with Row-Level Security

6 noctarius 4 9/18/2025, 9:46:36 AM simplyblock.io ↗
Utilizing Postgres' RLS feature to isolate user data instead of easy-to-forget where-clauses, is such an underrated use case, I really wonder why not more people use it.

If you prefer code over the blog post, I've put the full application example on GitHub. Would love to hear your thoughts.

https://github.com/simplyblock/example-rls-invoicing

Comments (4)

pwlm · 48m ago
From Postgres docs https://www.postgresql.org/docs/current/ddl-rowsecurity.html

I built multi-tenant services and never used RLS because it's complicated.

noctarius · 43m ago
It is complicated to initially wrap your head around, I agree. That's why I thought a demo application is the best way to show that it doesn't have to be super complicated once understood.

Like many things in PG, they aren't always easy to get right away I remember my first time with it years and years ago.

MohanYC · 45m ago
Great share!
noctarius · 42m ago
Thank you very much :)

Happy to get any idea on how to make it even better!