I’m trying to move the database of a local app to a new folder.
I’ve changed the config file to point to the new folder.
I’ve rsynced to the new folder using -av. Permissions match the old folder.
When starting the database its giving “Can’t access folder. Permission denied.”
I’ve tried changing the permissions as liberal as possible as a test (777). I’ve tried changing the users… I’m still getting the error.
The configs are right. Its trying to access the correct folder. But no matter the what the permissions are set to, it throws the error.
Can you imagine anything else that would cause a permissions denied error other than the actual permissions?
Yes… just to experiment, I’ve change everything to 777 recursively.
It’s a local app. The old location was in the root folders domain… the new one was within /home/user. I suspect this might have something to do with it.
I suspect this is the issue.
I’ve tried changing the user. So far no luck.
If I want to give posgres access to the /home/user directory how would I do it?
Anyone know if a simlink will have the same constraint? And/or if there are anyworkarounds? I need to store the database in the user directory somehow.
Can you explain why you need to save the data in that folder?
You could change the access rights on the parent directory as well, but I’m not sure that’s good for security.
Another option might be to run postgres as that user and give the user the necessary rights so it’s able to run postgres.
Maybe use chown to change ownership of the folder to the postgres user (though that’s kind of strange to have another user own its entire /home/user directory but not/home/user/pgdata but still, you can try it). Or indeed make Postgres run as the user whose home dir that is.