Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
remus
· 6y ago · 0 comments
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.
Comments
[–]
chatmasta
6y ago
Not necessarily. You can SET ROLE at beginning of transaction and DISCARD afterward. This is what postgraphile and postgrest do, for example.
[–]
remus
OP
6y ago
Oh cool, I didn't know that. Good to learn!
[–]
steve-chavez
6y ago
postgrest actually does a `SET LOCAL ROLE`(transaction scoped, so no need to DISCARD), but yes, that's the gist of it.
[–]
BenjieGillam
6y ago
This 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_Securit...
[–]
devit
6y ago
You can just change the user for every query.