3 ms·
No, RLS does not necessarily require separate database users. Using database users is one relatively obvious way to use the feature, but you can very well do so
by anarazel 11y ago
No, RLS does not necessarily require separate database users. Using database users is one relatively obvious way to use the feature, but you can very well do something like 'SELECT myapp_set_current_user(...)' or something, and use a variable securely set therein for the row restrictions.
- jimktrains2 11y agoInteresting. I didn't think about doing that. 9.2 makes that much easier to do http://dba.stackexchange.com/questions/97095/set-session-custom-variable-to-store-user-id http://dba.stackexchange.com/questions/97095/set-session-cus...
- Jweb_Guru 11y agoYep. We do this where I work (the 9.4 equivalent using SECURITY BARRIER views) and it is extremely useful.