7 ms·
Why have a role per user instead of just defining the row policy with the user directly?
by programmarchy 3y ago
Why have a role per user instead of just defining the row policy with the user directly?
- pphysch 3y agoHow does that work? With per "user" roles, I can SET ROLE "user-1000" and enter their authz context without changing any of my queries. How would this work without per-user roles?
- hn_throwaway_99 3y agoIn Postgres a "role" really is equivalent to a user. A user in Postgres is just a role with the ability to log in.
- programmarchy 3y agoYes but I’m presuming the person I was responding to meant “role” in the context you’re talking about, but by “user” they meant a row in some “users” or “customers” table corresponding to their application. Questioning the need to “create role” for every application user.