model-writtenrun 7241 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
Dec 2022 - Jan 2023 · 12 entries
- Nathan Bossart opened the thread with separate grantable CLUSTER, REFRESH MATERIALIZED VIEW, and REINDEX privileges plus predefined roles, aiming to reduce operations requiring ownership or superuser privileges #1.
- Jeff Davis questioned whether refreshing every materialized view was an administrative operation #2, while Nathan reported that discussion elsewhere favored grouping the maintenance commands under MAINTAIN #3.
- Nathan consolidated the privileges and predefined roles into MAINTAIN and pg_maintain, simplified the existing VACUUM/ANALYZE checks, and corrected a documentation typo #4 #5.
- Jeff committed that version with additional LOCK TABLE support, callback renaming, and error-message and test changes as 60684dd834, announcing the addition in #6; the other linked thread thread #47056 supplied design discussion rather than the implementation.
- Pavel Luzanov immediately demonstrated that granting MAINTAIN on a table still left its TOAST table unvacuumed #8; Alvaro Herrera and Jeff agreed that maintaining the main table should permit maintaining its TOAST storage #10 #12.
- The discussion kept partition creation outside MAINTAIN's scope and retained CLUSTER and REFRESH within the combined privilege despite questions about their application-specific effects #13 #14 #15.
- Pavel's partition example exposed inconsistent behavior among maintenance commands #16, and Jeff confirmed that REINDEX processed partitions while CLUSTER and VACUUM/ANALYZE could skip them #21 #25.
- After Michael Paquier raised lookup and locking concerns around finding a TOAST table's parent #20, Nathan proposed bypassing privilege checks only when VACUUM recursively processes TOAST storage #22; Pavel supported extending that model to partitions #23.
- Justin Pryzby explained CLUSTER's silent partition skipping #28, and Nathan supplied a separate warning patch while describing why CLUSTER's locking and transaction behavior differed from VACUUM #29.
- Nathan then broadened the fix to look up partition roots and TOAST parents instead of bypassing checks, allowing direct maintenance through inherited parent permissions #33; subsequent revisions added a TOAST lookup index, warnings, Ted Yu's typo fix, and documentation and test adjustments #35 #37 #38 #41.
- Jeff found that the lookup design mishandled TOAST tables belonging to partitions and opposed adding a pg_class index solely for these checks #42; he argued that direct TOAST targeting could remain separate work because its interface already required internal names and schema access #44.
- Nathan split the work into partition and TOAST patches, replaced TOAST-parent lookups with recursive skip_privs handling, and changed partition checking to consider any ancestor #45; the rebased pair #46 landed unchanged together as ff9618e82a.
Jun 2023 · 9 entries
- In June, Nathan reopened the issue because partition-ancestor syscache lookups lacked relation locks and might fail during concurrent changes #47; Michael confirmed the hazard and also proposed moving skip_privs into VacuumParams #48.
- Nathan posted a partial revert preserving the TOAST fix and a separate option-bit refactoring #50, while Jeff supported removing partition-hierarchy support rather than risking the upcoming release #51.
- Michael questioned the removed ownership checks #52, and Nathan explained that separate owner bypasses would defeat explicitly revoked MAINTAIN privileges #53; this led to simplified privilege documentation, subsequently separated from the code fix #54 #55 #56.
- Jeff supported consistency with other grantable privileges #58 and caught an option-mask bug that discarded the new TOAST bypass flag #59; Nathan corrected the masks while preserving command-specific warnings #60 #63, and Jeff approved the result #65.
- The corrected refactoring landed unchanged as 5b1a879943, after which Nathan resent the remaining partition-check removal and documentation patches #66 #67.
- Jeff and Michael examined REINDEX's continued processing of partitions without individual privilege checks #64 #68; they left that existing behavior for possible future reconsideration, and Nathan added an explicit documentation explanation #72 #73.
- Michael requested a CLUSTER test for a user who owns a partition but lacks privileges on its parent, plus a comment explaining leaf permission checks #69 #75; Nathan incorporated both #76, and Michael accepted the final comment #77.
- The two components of the final submission #76 landed unchanged as the cache-hazard fix 4dbdb82513 and privilege-documentation cleanup c2122aae63, retaining recursive TOAST handling while removing partition-ancestor permission inheritance.
- Nathan closed the thread by confirming both commits and resolving the PostgreSQL 16 open item #79; the submitted series was complete, with broader REINDEX consistency changes deferred for a separate discussion #67 #72.