model-writtenrun 6229 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Alex Kozhemyakin reported that upgrading from PostgreSQL 13 to 14 with earthdistance installed failed when updating cube because type earth already belonged to earthdistance #1.
- Tom Lane reproduced the failure without pg_upgrade and traced it to ALTER TYPE recursively updating dependent domains, which could incorrectly absorb those domains into the cube extension #2.
- Tom's patch made ALTER TYPE and ALTER DOMAIN preserve extension membership while retaining object adoption for shell replacement and CREATE OR REPLACE; he also proposed applying the same rule to ALTER OPERATOR and changing the dependency function's signature in stable branches #3.
- Andres Freund questioned the shell-type circular-dependency example but accepted omitting a compatibility wrapper for the signature change #4.
- In the thread's final message, Tom defended preserving intentional shell-replacement behavior in a backpatched fix and left any stricter future policy unresolved #5.
- Tom subsequently committed the attached patch with the additional ALTER OPERATOR fix as 6b71c925cb, with backports through PostgreSQL 13; the commit declined to change older branches because the older ALTER cases affected only explicitly targeted objects.