model-writtenrun 5469 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Franz-Josef Färber reported that restoring a pg_trgm index failed with a schema-permission error in PostgreSQL 14.3 but succeeded in 14.2, because pg_dump emitted the schema grant after index creation #1.
- Tom Lane connected the regression to the CVE-2022-1552 userid changes and warned that moving grants earlier would break other cases; Noah Misch isolated a reproducer without pg_dump and proposed switching identity around operator-class lookup #2 #3.
- Robert Haas requested a clear security rationale for deciding which operations use the caller's privileges, and Tom Lane agreed that restoring dump compatibility required careful security review #4 #6 #7.
- Nathan Bossart supplied a proof of concept switching identity around ResolveOpClass(), then polished its names, documentation and regression test; Noah Misch suggested tracing ACL checks to identify other affected paths #9 #10 #12.
- Nathan Bossart subsequently identified exclusion-operator lookup as another likely failure, and Noah Misch took over the implementation, also finding collation lookup failures and search_path changes leaking from index-expression planning into lookup #13 #16 #18.
- Noah Misch's expanded patch covered all three lookups, discarded GUC changes before restoring the caller's identity and added comprehensive citext tests; he deferred moving name resolution into transformIndexStmt() because of extension compatibility and left a DefineIndex() restructuring unexplored for lack of time #18.
- Nathan Bossart found the expanded patch reasonable but questioned its operator-class security argument; Noah Misch explained that only superusers can define operator classes and justified using citext for realistic, compact tests, which Nathan accepted in the thread's final message #19 #20 #21.
- After the thread ended with Noah Misch planning to push, 00377b9a02 landed the patch from #18 with only a defensive search_path reset and comments added to its tests, crediting Nathan Bossart and Noah Misch and backpatching the fix through PostgreSQL 10.