Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question

1 Answer 1

up vote 6 down vote accepted

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

share|improve this answer
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. –  Michael Graff 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

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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