Skip to content

What are some rules of thumb when choosing between RLS and security barrier views? #3424

Discussion options

You must be logged in to vote

Hey @chipilov,

With that in mind, what are some rules of thumb about when to use RLS and when to use security barrier views?

Security barrier views predate policies, they were used at a certain point to implement row-level security. See this blog post for more details.

With the security barrier approach you basically have to recreate the RLS functionality manually in your VIEWs. It works, but it's more complicated.

With RLS you can be fine-grained about statement type(INSERT/UPDATE/DELETE) and the postgres role for which the policy is applied.

while the view provides access control on the column axis (i.e. it only allows certain columns to be visible)

Note that you can also combine re…

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@chipilov
Comment options

@steve-chavez
Comment options

@chipilov
Comment options

Answer selected by chipilov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants