Basically, I'm wondering whether materialized views are likely to ever support row-level security.
I've been toying with using MVs to address some performance issues, until coming across this issue.
As explanation of the use case, I've got a DB that is shared across multiple sites ("segments"). Each site is a different DB user, and access to data is controlled by a function (has_segment_access).
So for a table, and a view, we use:
CREATE POLICY tbl_client_sites ON tbl_client FOR ALL USING (has_segment_access(agency_segment_code));
CREATE VIEW client AS SELECT * FROM tbl_client WHERE has_segment_access(agency_segment_code);
I'd been thinking I could just materialize some of these views, but then they are frozen data, like a table. But unlike a table, you can't apply RLS. Hence the email. Any insight or development crystal-balling appreciated. Thanks!