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.
This commit is contained in:
Yau-Hsien Huang 2022-11-06 20:48:02 +08:00 committed by GitHub
parent 0a072a2287
commit 05154dab07
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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": [