model-writtenrun 5760 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Ryan Kelly reported that upgrading to PostgreSQL 11.15 caused count(*) and similar queries to fail with “variable not found in subplan target list,” while count(id) worked #1; after Tom Lane requested a self-contained example #2, Ryan supplied a reproducer #3.
- Tom Lane traced the failure to an index-only scan using a gist_trgm_ops index whose columns could not be returned, explaining that stricter setrefs.c checks exposed an already-invalid plan and that tied index costs explained the apparently inconsistent behavior #4.
- Tom Lane proposed disabling the physical-target-list optimization whenever an index-only scan has a non-returnable column #4, then committed the identical code with added GiST regression tests and backported the fix to all supported branches e5691cc917.
- Two months later, Andrey Borodin reported that applying the patch fixed his query and asked whether anything remained before release #5, correcting his affected version from 10.10 to 10.20 #6.
- Tom Lane pointed Andrey Borodin to the existing commit #7 e5691cc917, and Andrey confirmed that he had overlooked it in REL_10_STABLE, leaving no outstanding patch work in the thread #8.