Using Materialized Views for RLS in Supabase: Best Practices and UI Limitations #17790
-
BodyHello everyone, I'm working on a project where I need to calculate the final cost ( Context:
Why Materialized View?I opted for a materialized view for two main reasons:
Questions:
Any insights or recommendations would be greatly appreciated. Thank you! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
You can enforce RLS on regular views now with security_invoker. https://www.postgresql.org/docs/current/sql-createview.html |
Beta Was this translation helpful? Give feedback.
-
I'm fairly certain PostgreSQL as of v15 does NOT support RLS on materialized views, in contrast with regular views which do using security_invoker = true. |
Beta Was this translation helpful? Give feedback.
You can enforce RLS on regular views now with security_invoker. https://www.postgresql.org/docs/current/sql-createview.html
The UI is limited to displaying views and you need to use SQL to edit them.