On Windows, PostgreSQL installation may fail during database cluster initialization when using certain system locales (not only Turkish).
Root cause: locale / collation incompatibility during initdb.
Solution:
Always install PostgreSQL using the en_US locale, regardless of your system language.
During installation, PostgreSQL may fail with an error similar to:The database cluster initialization failed.
The installer may then roll back and remove installed binaries automatically.
PostgreSQL relies on system locale and collation settings during initdb.
On Windows, some locales (such as tr_TR, az_AZ, lt_LT, and others) can cause
collation or ICU-related issues. These issues prevent PostgreSQL from correctly
initializing the default database cluster.
This is not a PostgreSQL bug specific to Turkish — it affects multiple locales.
On Windows, PostgreSQL relies on ICU and Windows locale APIs, which behave differently than POSIX locales used on Linux systems.
-
Uninstall PostgreSQL from Apps & Features
- Ignore uninstall errors if any occur
-
Manually delete the remaining directory:C:\Program Files\PostgreSQL
-
Run the PostgreSQL installer as Administrator
-
During installation, when prompted for Default Locale:
❌ Do NOT select your system language
❌ Do NOT select tr_TR, az_AZ, lt_LT, etc.
✅ Select English (United States)
or
- Complete the installation
PostgreSQL should now initialize the database cluster successfully.
If PostgreSQL is already installed but the cluster failed, you can manually initialize it:
initdb -E UTF8 --locale=en_US -U postgres -D C:\pgsql\data
pg_ctl start -D C:\pgsql\data
> Run Command Prompt or PowerShell **as Administrator**
Key Takeaway
On Windows systems, PostgreSQL should always be installed using the en_US locale,
regardless of the system language or regional settings.
This avoids collation issues and prevents database cluster initialization failures.
Keywords (for search engines)
postgresql database cluster initialization failed
postgresql windows locale error
initdb failed windows
postgresql tr_TR locale bug
postgresql ICU collation issue
postgresql windows installation failed
postgresql initdb locale windows
## License
MIT License
