3 ms·
It also means you need a per-user database connection which isn't feasible in many applications as the recommended number of concurrent connections is typically
by remus 7y ago
It also means you need a per-user database connection which isn't feasible in many applications as the recommended number of concurrent connections is typically quite low.
- chatmasta 7y agoNot necessarily. You can SET ROLE at beginning of transaction and DISCARD afterward. This is what postgraphile and postgrest do, for example.
- steve-chavez 7y agopostgrest actually does a `SET LOCAL ROLE`(transaction scoped, so no need to DISCARD), but yes, that's the gist of it.
- remus 7y agoOh cool, I didn't know that. Good to learn!
- devit 7y agoYou can just change the user for every query.
- BenjieGillam 7y agoThis absolutely isn't required; I think you might be getting confused with RBAC rather than RLS. Handy infosheet: https://learn.graphile.org/docs/PostgreSQL_Row_Level_Security_Infosheet.pdf https://learn.graphile.org/docs/PostgreSQL_Row_Level_Securit...