model-writtenrun 8504 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Jeff Davis reported that EXPLAIN ANALYZE CREATE MATERIALIZED VIEW bypasses security-restricted execution, allowing operations that ordinary creation and later REFRESH reject; he described this as a consistency issue rather than a security vulnerability and raised possible EXPLAIN support for REFRESH #1.
- Kirill Reshke proposed fixing supported releases promptly and moving the security-context setup into create_ctas_internal(), but Jeff Davis explained that restrictions must apply before planning because the planner can execute functions, suggested further code sharing with REFRESH, and questioned rushing the fix #2 #3 #4.
- Yugo Nagata identified the additional queries executed by REFRESH CONCURRENTLY as a complication for EXPLAIN support, and Kirill Reshke suggested displaying them similarly to trigger information; no design was settled #5 #6.
- Yugo Nagata submitted a small fix that restricted the security context and search_path before planning, while asking whether integrating REFRESH machinery would be preferable; Kirill Reshke objected that materialized-view-specific handling belonged at a different abstraction level #7 #8.
- Yugo Nagata then found that restricting search_path before relation creation made the patch attempt creation in pg_catalog and suggested creating the empty relation first; Jeff Davis supported separating creation from the explained population step and discussed extending REFRESH machinery to support it #9 #10.
- Tom Lane questioned the value of explaining materialized-view creation when the underlying SELECT can already be explained, while distinguishing the potential value of showing REFRESH-specific work #11.
- Yugo Nagata revised his patch to resolve and explicitly qualify the destination schema before restricting search_path, retaining the smaller implementation while leaving its merits versus REFRESH integration open #12.
- Jeff Davis clarified that EXPLAIN ANALYZE CREATE MATERIALIZED VIEW was already supported and outlined alternatives ranging from leaving the inconsistency alone to shared execution machinery and progressively broader REFRESH support, with backpatching also undecided #13.
- After more than two years, Zsolt Parragi submitted an independently written fix that creates the empty view in the caller's context, then plans and executes under restrictions while keeping the view open to prevent conflicting DDL; it adds receiver support for an existing relation and tests for schema handling, pg_temp creation, and planner-triggered index creation #14.
- The thread ends with Zsolt Parragi's patch awaiting review, with no linked commit or subsequent acceptance shown; EXPLAIN REFRESH support and backpatching remain unresolved #14 #13.