Hi Laurenz,
Apologies for the inconvenience,I have shared the detailed description below. Kindly provide a solution for this issue.
I have tried to initialize data directory using this below command,
initdb.exe -D "..\data" -U postgres --no-locale -E UTF8
Exact error returned by postgres,
initdb: error: The program "postgres" was found by "E:\pgsql\bin/initdb.exe"
but was not the same version as initdb.
Check your installation.
I have tried with different chcp values(1252,437.. etc) that are supported by
postgres but doesn't work for my case(encoding command also changed according to registry chcp value) .If I remove the
Active code page : 65001 from the registry editor, then the above mentioned initdb command executes successfully.
Successful execution log for your reference,
Microsoft Windows [Version 10.0.19045.3324]
(c) Microsoft Corporation. All rights reserved.
E:\pgsql\bin>initdb.exe -D "..\data" -U postgres --no-locale -E UTF8
The files belonging to this database system will be owned by user "gokul".
This user must also own the server process.
The database cluster will be initialized with locale "C".
The default text search configuration will be set to "english".
Data page checksums are disabled.
creating directory ../data ... ok
creating subdirectories ... ok
selecting dynamic shared memory implementation ... windows
selecting default max_connections ... 100
selecting default shared_buffers ... 128MB
selecting default time zone ... Asia/Calcutta
creating configuration files ... ok
running bootstrap script ... ok
performing post-bootstrap initialization ... ok
syncing data to disk ... ok
initdb: warning: enabling "trust" authentication for local connections
You can change this by editing pg_hba.conf or using the option -A, or
--auth-local and --auth-host, the next time you run initdb.
Success. You can now start the database server using:
pg_ctl -D ^"^.^.^\data^" -l logfile start
Registry Editor key I have removed,
Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Command Processor\Autorun -> Removed the Value data(chcp 65001) content.
My Current System locale is English (United States)
Gokul