1

I moved the postgres data directory to a separate partition and it works great. The directory is owned by postgres user and postgres group.

d-wx------ 11 postgres postgres 4.0K 2010-06-11 08:28 data/

I added myself to the group

> sudo addgroup me postgres

> groups me

me : me adm dialout cdrom plugdev lpadmin admin sambashare postgres

And gave the group read and execute permissions to everything in the directory.

sudo chmod -R g+rx ./data

d-wxr-x--- 11 postgres postgres 4.0K 2010-06-11 08:28 data/

But I still can not CD or LS the directory.

> ls data

ls: cannot open directory data: Permission denied

What beginner mistake am I making?

6

Log out and back in again. That will properly set your groups, which are set only on log-in.

2
  • 2
    BTW, you probably don't want to be in the postgres group anyway. You don't need to be in it to use PostgreSQL, all that does is allow you direct access to the data and config files. You probably want to use sudo to get that access in the rare time you will change config. Jun 11 '10 at 15:23
  • 1
    Well, I was lazy and also wanted to try doing something like this. But FYI - postgres will not let you set permissions to anything other than 700 for the data directory.
    – Jonathan
    Jun 11 '10 at 17:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.