model-writtenrun 7875 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Bharath Rupireddy proposed checking target-relation existence before rewriting or planning CREATE TABLE AS and CREATE MATERIALIZED VIEW, including their EXPLAIN forms, and supplied the initial patch in #1.
- Zhijie Hou suggested simplifying error reporting and questioned making plain EXPLAIN fail when its target already exists in #2; Bharath initially proposed limiting the EXPLAIN check to ANALYZE in #3, but that restriction did not enter the subsequent patches.
- Michael Paquier used a data-modifying WITH query to challenge the handling of EXPLAIN with IF NOT EXISTS in #8 and clarified that an existing target should prevent both planning and execution in #9; Bharath agreed that IF NOT EXISTS should produce a notice and discussed returning an empty plan in #10.
- Bharath simplified error reporting in #11, while still making EXPLAIN fail for existing targets even with IF NOT EXISTS; Michael identified the remaining inconsistency and requested explicit regression coverage in #12, leading to the tests in #14.
- Michael supplied a revision in #15 that made IF NOT EXISTS consistently issue a notice and skip the statement, including under EXPLAIN, and replaced repetitive tests with queries containing division by zero to demonstrate that planning was bypassed; Bharath then refined the helper's name and comments in #16.
- Michael added dummy-plan output for non-text EXPLAIN formats, renamed the helper CreateTableAsRelExists, and added prepared-query regression coverage in #17; Bharath aligned the helper's Boolean result with its name in #18.
- Michael suggested testing at least one non-text format in #19, but Bharath reported manually checking all formats and chose to omit additional automated cases to avoid introducing explain_filter into the regression files in #20.
- Michael committed #18 as e665769e6d, adding an unexpected-object-type error guard and polishing comments and formatting; his final announcement in #22 closes the thread with the patch applied and no remaining patch series.