When trying to start the Postgres database service, you get this error:
FATAL: could not remove old lock file “postmaster.pid”: Permission denied
2018-05-23 01:08:50 GMT HINT: The file seems accidentally left over, but it could not be removed. Please remove the file by hand and try again.
Postgres can have trouble removing the old lock file if there are read only permissions on the folder structure containing the Postgres database. This can be NTFS read only permissions or even just the tick box saying “Ready only” on the properties page of the folder.
To fix this, deselect the Read only checkbox and ensure that there are read and write NTFS permissions on the folder containing the Postgres database.