model-writtenrun 91 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- shihao zhong reported that translated hidden-query comments could break psql backslash commands when locale and connection encodings differed, especially in scripts, and proposed stripping unsafe comments before execution while retaining them in -E output #1.
- Fujii Masao showed that matching locale and client encodings still allowed conversion failures against a differently encoded database and suggested untranslated labels; shihao responded with both an English-only alternative and a stricter three-encoding guard #2 #3.
- Tom Lane proposed centralizing label construction in addQueryComment(), while Fujii raised OUTPUT_CHARSET and Windows uncertainties and supported English fallback; shihao adopted the helper and preserved English comments when translation seemed unsafe #4 #5 #6.
- Tom's next review led to registering the helper as a gettext trigger and checking encoding safety before performing translation, while shihao demonstrated that OUTPUT_CHARSET also affected gettext on Linux #7 #8.
- Fujii reproduced a failure after unsetting OUTPUT_CHARSET because gettext retained an earlier value, prompting shihao to revise environment tracking and report 12,000 fuzz cases without errors on Linux and macOS #9 #10.
- Tom extracted the helper, call-site conversions, and gettext registration from #10 into 294d2196c7, deliberately leaving translation unconditional, then posted the remaining safety logic with stronger tracking of runtime OUTPUT_CHARSET changes #11.
- Tom then proposed abandoning locale inference and OUTPUT_CHARSET tracking in favor of matching client/server encodings and validating the translated bytes with the server's own verifier, accepting that readable text could not be guaranteed; Fujii agreed #12 #13.
- shihao implemented that simplification with an additional UTF8-only restriction after finding a WIN1252 case that could disrupt pg_stat_activity, but Tom argued that defective validation should be fixed separately, leading shihao to restore support for all matching encodings and defer validator work until after PostgreSQL 19 GA #14 #15 #16.
- Tom observed that direct byte validation also removed the reason to exclude Windows, and shihao removed that exclusion from the final submission #17 #18.
- Tom committed #18 as f242a81b81 with explanatory-comment edits, completing the encoding fallback fix; both commits were backpatched to PostgreSQL 19, and Tom announced the final push in #19.
- The thread ended with the psql fix fully landed and shihao confirming that the separate validator work remained queued for after PostgreSQL 19 GA #20.