From 05154dab072f1e01dfb14b58717b5bacadbe96d3 Mon Sep 17 00:00:00 2001 From: Yau-Hsien Huang Date: Sun, 6 Nov 2022 20:48:02 +0800 Subject: [PATCH] postgresql: Fix "FATAL: role 'postgres' does not exist" (#4095) A problem, caused by using the old line `Invoke-ExternalCommand -FilePath \"$dir\\bin\\initdb.exe\" -ArgumentList \"--username=postgres --encoding=UTF8 --locale=en --lc-collate=C\" | Out-Null`, occurs in Windows so that people could not login by the default superuser Id "postgres" By migration to the new line `Invoke-ExternalCommand -FilePath \"$dir\\bin\\initdb.exe\" -ArgumentList @('--username=postgres', '--encoding=UTF8', '--locale=en', '--lc-collate=C') | Out-Null`, the issue is eliminated. --- bucket/postgresql.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bucket/postgresql.json b/bucket/postgresql.json index af3fd60b48..178eb0f730 100644 --- a/bucket/postgresql.json +++ b/bucket/postgresql.json @@ -22,7 +22,7 @@ ], "post_install": [ "if (!(Test-Path \"$dir\\data\\pg_hba.conf\")) {", - " Invoke-ExternalCommand -FilePath \"$dir\\bin\\initdb.exe\" -ArgumentList \"--username=postgres --encoding=UTF8 --locale=en --lc-collate=C\" | Out-Null", + " Invoke-ExternalCommand -FilePath \"$dir\\bin\\initdb.exe\" -ArgumentList @('--username=postgres', '--encoding=UTF8', '--locale=en', '--lc-collate=C') | Out-Null", "}" ], "shortcuts": [