On Windows Server 2022, I am logged in as Administrator and trying to do a pg_ctl start
on a Postgresql database that was initially created by user SYSTEM, but get the following error in the cmd console (I tried both with and without "Run as administrator"):
>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.
The specified log file contains this error:
2023-08-28 04:01:07.898 PDT [2088] PANIC: could not open file "global/pg_control": Permission denied
I checked the permissions for the data directory and they seem ok, both user SYSTEM and group Administrators have access to it: SYSTEM perms and Administrators perms. I also checked that the user Administrator really is part of the group Administrators: admins properties.
Why does this happen? Am I missing some permissions?
OS is running in a VM, full version info is:
Edition: Windows Server 2022 Standard
Version: 21H2
OS build: 20348.350
Weirdly enough, if I add full control permissions to the user Administrator or to the group Users, then the pg_ctl start
command runs successfully.