model-writtenrun 1760 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ayush Vatsa opened the thread with a pg_prewarm failure on an index despite SELECT access to its table, and subsequent examples established that ownership or superuser status could bypass the problem #1 #7 #8.
- Tom Lane considered ownership and maintenance roles, then proposed checking SELECT on the parent table because SELECT already permits manual warming; David G. Johnston and Robert Haas supported that behavior, while Tom warned about deadlocks from locking the index first #3 #12 #13 #16 #17.
- Ayush supplied the initial implementation and tests, and Nathan Bossart investigated concurrent DROP TABLE behavior before posting a tidied version that still relied on the index lock to protect the parent-table lookup #19 #23 #25.
- Tom questioned performing ACL checks on an unlocked table; Nathan proposed borrowing amcheck's parent-first locking and association recheck, and Tom requested a common implementation for the inconsistent existing callers #26 #27 #28.
- After a six-month gap, Nathan reported that the callers differed too much to justify unification and posted separate statistics, REINDEX, and pg_prewarm fixes, including parent-first locking for pg_prewarm #31.
- Tom pointed out that REINDEX deliberately checks privileges before locking to prevent denial of service, prompting Nathan to restore that ordering while retaining the other changes #32 #33.
- Jeff Davis then noticed that statistics still locked before checking privileges; Nathan agreed that statistics could use RangeVarGetRelidExtended(), while pg_prewarm's OID-based interface made that solution harder #36 #37.
- Nathan posted an experimental pg_prewarm retry loop that checked privileges before locking, but judged its invalidation-handling complexity difficult to justify and returned to the simpler implementation; the next series added a dblink conversion to RangeVarGetRelidExtended() #38 #39.
- Nathan subsequently rewrote statistics around RangeVarGetRelidExtended() and changed REINDEX to error on rare OID-reuse races after finding that its proposed unconditional unlock/relock behavior could itself deadlock #42.
- Jeff accepted ShareUpdateExclusiveLock for statistics indexes because the original lock choice served a removed in-place-update implementation, suggested errors for both exceptional OID-reuse cases, and endorsed the revised REINDEX and dblink components #45.
- Tom and Jeff debated whether brief unauthorized weak locks could cause meaningful denial of service, while Nathan proposed retaining pg_prewarm's simpler behavior for backpatching and considering broader changes for a future release #43 #44 #46 #47.
- Jeff endorsed the pg_prewarm fix and backpatch with clearer comments about parent-table privileges and OID reuse, while leaving broader enforcement of index privilege rules for another discussion #48.
- Nathan committed the unchanged dblink component from #42 as c9b299f6df, then posted the remaining three patches with Jeff's error-handling and comment suggestions incorporated #49.
- The statistics component of #49 landed with a small comment clarification as c8af5019be, but buildfarm members immediately exposed a repeated typedef incompatible with C99 on PostgreSQL 18 #51.
- Nathan repaired that build failure without another attached patch, replacing the RangeVar typedef forward declaration with a struct declaration in 15d7dded0e, as promised in #51.
- The REINDEX component of #49 landed unchanged as 079480dc20; Nathan decided against backpatching because the race was exceptionally rare and had no field reports #52.
- The pg_prewarm code from #49 landed as 19a64f5676 with its attached tests omitted, and Nathan declared all work tracked by the thread committed #53.
- The broader pg_prewarm check-before-lock redesign remained outside the completed work: Nathan's last assessment was that its complexity offered limited gain, although it might still merit future attention #50 #53.