Windows 上的 pg_ctl start 出現錯誤:無法開啟檔案「global/pg_control」:權限被拒絕

Windows 上的 pg_ctl start 出現錯誤:無法開啟檔案「global/pg_control」:權限被拒絕

在 Windows Server 2022 上,我以管理員身份登錄,並嘗試對pg_ctl start最初由用戶SYSTEM 創建的Postgresql 資料庫執行操作,但在cmd 控制台中出現以下錯誤(我嘗試了使用和不使用“以管理員身份運行”的情況) :

>pg_ctl.exe start -o "-p 5432" -U user -P password -D C:\aiw\aiw1\data -l C:\aiw\aiw1\trace\postgres.trace
waiting for server to start.... stopped waiting
pg_ctl: could not start server
Examine the log output.

指定的日誌檔案包含此錯誤:

2023-08-28 04:01:07.898 PDT [2088] PANIC:  could not open file "global/pg_control": Permission denied

我檢查了資料目錄的權限,看起來沒問題,使用者 SYSTEM 和群組管理員都可以存取它:系統權限管理員權限。我還檢查了用戶管理員確實是管理員群組的一部分:管理員屬性

為什麼會出現這種情況?我是否缺少某些權限?

作業系統在虛擬機器中運行,完整版本資訊是:

Edition: Windows Server 2022 Standard
Version: 21H2
OS build: 20348.350

奇怪的是,如果我向管理員使用者或使用者群組添加完全控制權限,則該pg_ctl start命令會成功運行。

相關內容