model-writtenrun 2741 - may be wrong, links go to the source messages. Commit-by-commit LLM analysis is in the Commits dialog.
- Koichi Suzuki reported that Windows psql corrupted certain SJIS filenames in \i, \ir, and \copy when a multibyte character contained a backslash-valued second byte #1.
- Tom Lane traced the likely fault to canonicalize_path(), explaining that psql's scanner already protected multibyte characters; Tatsuo Ishii confirmed the unconditional backslash replacement and opposed skipping conversion entirely because SJIS users still treat standalone backslashes as separators #2 #4 #5 #8 #12.
- Tom proposed using psql's client_encoding through a new canonicalize_path_enc() API while retaining the existing API's server-safe encoding assumption for installation and database paths; broader path-encoding enforcement was discussed but left outside this fix #13.
- Tatsuo suggested detecting Windows filesystem encoding, but accepted matching it to client_encoding after Tom explained that mismatched input would already trouble psql's scanner and that filename transcoding would introduce additional uncertainty #15 #16 #17.
- To avoid a libpgport dependency on libpgcommon or a disruptive relocation of path.c, Tom proposed embedding the small SJIS character-length routine locally, and Tatsuo supported that backpatch-friendly approach #14 #18.
- Tom submitted the sole patchset, adding SJIS-aware backslash conversion and passing pset.encoding from psql's path-handling callers, while noting that he could not test it himself #19.
- After several weeks, Koichi tested an EDB-built Windows installer containing the patch, confirmed that it worked, and requested fixes for older releases; Tom agreed to commit before the upcoming releases #20 #21.
- Tom committed the patch with only a comment wording change as 98df8bace8, with backpatches through PostgreSQL 13, and announced completion; Koichi confirmed its presence across master and the supported major branches, leaving no pending patch revisions #23 #24.