model-writtenrun 5420 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Dean Rasheed reported that a generated unnamed_join alias could hide a base relation with that explicit alias, causing FOR UPDATE to reject a query that should lock the base relation #1.
- Dean proposed skipping joins without visible aliases and matching JOIN USING aliases when no regular join alias exists, so attempts to lock those joins produce the correct error #1.
- The attached patch implemented those visibility rules and added five regression cases covering base-relation locking, JOIN USING aliases, and overriding regular join aliases #1.
- Tom Lane agreed with the correction and called the JOIN USING alias behavior an oversight; his agreement was the thread’s final message #2.
- Dean committed the patch unchanged the following day, credited Tom’s review, and specified backpatching the base fix to all supported branches and the JOIN USING alias fix through PostgreSQL 14, completing the submitted work #1 8d367a44d3.