model-writtenrun 9338 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Keith Fiske reported that Grafana initialization failed with duplicate-relation errors when one ALTER TABLE changed several indexed columns, while separate statements succeeded #1; Alvaro Herrera reproduced the failure and bisected it to the recent partial-exclusion-constraint fix #2.
- Tom Lane diagnosed cleanup running once per altered column instead of once per statement, creating duplicate index definitions, and raised the possibility of an urgent release #4; Michael Paquier noted the difficulty of the workaround and the importance of encouraging security updates #5.
- Tom's first patch restored capturing index definitions before any dependent column changed type and deferred filtering constraint-owned indexes until final cleanup #6; Keith confirmed that it fixed his PostgreSQL 11.4 reproducer #7.
- Tom then discovered that a partial exclusion index can depend on a predicate column without its constraint depending directly on that column, so he replaced deferred filtering with immediate lookup and rebuilding of the owning constraint, retaining the existing dependency model for released branches #8.
- The regression output also led Tom to propose simplifying psql's index ordering to put the primary key first and all remaining indexes in name order #9; Keith separately confirmed that the revised ALTER TABLE patch worked against HEAD #10.
- While preparing backports, Tom extracted shared rebuilding helpers to avoid duplicating constraint-handling code that differed across branches #12; the resulting patch landed unchanged as f946a40914, incorporating reversion of the faulty predecessor and receiving backports to all supported branches.
- Tom also proposed moving the unrelated generic-options function out of the ALTER COLUMN TYPE code #12, which landed separately with comment improvements as ccfcc8fdbd without an attached patch.
- At the thread's last message, the backend fixes had landed and Tom submitted the separate psql ordering patch, rejecting both an expanded preference for exclusion indexes and removal of primary-key priority #13; that patch subsequently landed unchanged as 4d6603f28d.