model-writtenrun 8667 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Hugh Wang reported that reconnecting with psql after losing the server connection could crash because strcmp() received a NULL result from PQhost() #1.
- Michael Paquier reproduced the failure on development and PostgreSQL 12 branches and posted a patch guarding the PQhost() result before comparing host names #2.
- Tom Lane identified another unsafe use involving PQdb() and proposed disabling reuse altogether when the old connection was absent #3; Alvaro Herrera agreed #4.
- Michael posted the revised guard setting reuse_previous to false when o_conn was NULL #5, and Tom and Alvaro accepted that version #6 #7.
- The revised patch landed unchanged as 8d84dd0012, with a backport to PostgreSQL 12; Michael confirmed completion and thanked both reviewers in the final message #8.