initdb.exe Fails on Windows When Password File Path Contains Non-ASCII Characters - Mailing list pgsql-hackers

From Manika Singhal
Subject initdb.exe Fails on Windows When Password File Path Contains Non-ASCII Characters
Date
Msg-id CAB1XC2Lw8_zTa=v2Rxu=hRik1vbTgk0yfC-PT1eODWjHuhgbMg@mail.gmail.com
Whole thread Raw
Responses Re: initdb.exe Fails on Windows When Password File Path Contains Non-ASCII Characters
List pgsql-hackers
Hi,

The postgresql windows installer packaged by EDB, creates the postgresql instance on the fly.
It creates a temporary file to store the password and then deletes it once the initdb is run successfully.
But a user reported the initdb fails. On debugging it was found that, it occurs because the username in the
%TEMP% contains the non-ascii characters as shown in the example below
initdb.exe --pgdata="C:\Program Files\PostgreSQL\17\data" --username=postgres --encoding=UTF8 --pwfile="C:\Users\玛妮卡\AppData\Local\Temp\passwdXXX" --auth=scram-sha-256 initdb: error: could not open file "C:\Users\???\AppData\Local\Temp\psswrdXXXX" for reading: No such file or directory ... .... It seems that initdb.exe does not correctly handle paths containing Unicode characters, replacing them with ???
in the error message. I want to ask if this is the expected behaviour of initdb.exe? When the user temp location is replaced with system temp (c:\windows\temp) the error goes away.
Any suggestions if the installer should use this path to create the password file?


-----------------------------
Thanks & Regards
Manika Singhal
EDB India

pgsql-hackers by date:

Previous
From: Jim Jones
Date:
Subject: Re: Reducing the log spam
Next
From: Manika Singhal
Date:
Subject: Re: initdb.exe Fails on Windows When Password File Path Contains Non-ASCII Characters