I'm trying to set up PostgreSQL for local use on my desktop and I ran into a weird problem. I can't seem to find a simple way to make the database cluster (which is just a directory) only accessible to the postgres user and completely accessible to the same. In other words, I want postgres (the user) to have full access to the directory, but everyone else to just be able to read what's in it (so that files can be copied).
I've created the user 'postgres', removed them from all groups and denied write permission to the 'Users' group. However, when I try to initialize the database, the postgres user seems to be unable to write to the directory - once I remove write denial from 'Users', it works fine.
I know I could do something like deny write permissions to my default user (myself essentially), but this user belongs to 'Administrators' and not 'Users'. Since apparently all users belong to 'Users' implicitly and denial takes precedence, I'm afraid I'd be denying myself, the only administrator, capability to modify this directory at any point in the future.
I've seen some other instructions that involve Group Policy etc. but they don't seem to be specific enough and the process feels way too complicated, which makes me think I'm misunderstanding NTFS/Windows permissions entirely. This feeling is further compounded by the fact that I can think of how to do this on Linux in 5 minutes and simply. I'm not even sure if it's possible at this point.
How would I give a specific user sole access on a directory and nobody else?
edit: I think I can boil down this question to a simpler one: Is there any way of disallowing anything to a user that belongs to the Administrator group? And if you did that, would you be able to restore permissions to what they used to be?