Thread: BUG #18827: PostgreSQL 17.4-1 Installation – Database Cluster Initialization Failed Due to Execution Policy
BUG #18827: PostgreSQL 17.4-1 Installation – Database Cluster Initialization Failed Due to Execution Policy
From
PG Bug reporting form
Date:
The following bug has been logged on the website: Bug reference: 18827 Logged by: Abhishek Zararia Email address: abhishekzararia@gmail.com PostgreSQL version: 17.4 Operating system: Microsoft Windows 10 Description: Dear Support Team, While installing PostgreSQL 17.4-1, I encountered the following error during database cluster initialization: *************************************** Error running C:\windows\System32\cmd.exe /c "C:\windows\System32\WindowsPowerShell\v1.0\powershell.exe" -ExecutionPolicy Bypass -File "C:\Program Files\PostgreSQL\17/installer/server/initcluster.ps1" "NT AUTHORITY\NetworkService" "postgres" "****" "C:\Users\<User>\AppData\Local\Temp/postgresql_installer_f3480bc391" "C:\Program Files\PostgreSQL\17" "C:\Program Files\PostgreSQL\17\data" 5432 "DEFAULT" 0: File C:\Program Files\PostgreSQL\17\installer\server\initcluster.ps1 cannot be loaded. The file C:\Program Files\PostgreSQL\17\installer\server\initcluster.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170. + CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException + FullyQualifiedErrorId : UnauthorizedAccess Problem running post-install step. Installation may not complete correctly The database cluster initialisation failed. *************************************** Upon investigation, I found that my System Execution Policy (Get-ExecutionPolicy -List) had "MachinePolicy" set to "AllSigned", which caused the installation to fail due to script signature enforcement. When I changed "MachinePolicy" to "Undefined", the installation proceeded successfully, and the PostgreSQL service started without issues. Could you confirm if this is the expected behavior in PostgreSQL 17.4-1? I did not encounter this issue in previous PostgreSQL versions. Was this change intentional, or is it an overlooked error? Awaiting your response. Best regards, Abhishek Zararia