At Tue, 12 Sep 2023 14:36:03 +0530, Gokul Krishnan <gokulkrishnan99102@gmail.com> wrote in
> Hi Laurenz,
> I have shared all the required details in previous mail, Kindly provide a
> solution for this issue.
Thanks for the info. It suspect that the issue arises because chcp
prints "Active code page: 65001", which can clutter things up in
various situations. AFAICS there's no option to silence it. It's
puzzling why Microsoft would suggest such a problematic setup (if it
really does).
When initdb probes for the postgres version, it uses _popen. From what
I gather, it uses cmd.exe. This action then may automatically runs
chcp, injecting the line "Active code page: 65001" to the output. You
can observe this with the following command line. initdb expects the
secondline to come first.
> work>cmd /c pgsql\bin\postgres -V
> Active code page: 65001
> postgres (PostgreSQL) 17devel
For the record, I couldn't reproduced this issue on Windows 11, so I
didn't observed what actually happens in this situation. Not entirely
sure why, but maybe _popen in that version either bypasses cmd.exe or
prevents it from executing autoruns. But, I face hiccups with
VsDevCmd.bat when pulling output from subshells.
As the result, I'd advise against doing that, especially on the server
running PostgreSQL.
I don't think we want to "fix" this issue, especially if Windows 11
has already adressed it. But I'm not sure about this.
regards.
--
Kyotaro Horiguchi
NTT Open Source Software Center