[OSX] pg_ctl: could not open PID file

For some reason Posgresql won't start anymore. When I start PGAdmin I get the following message:

Server doesn't listen
The server doesn't accept connections: the connection library reports
could not connect to server: Connection refused

In the error log I find the following message:

com.apple.SystemStarter[21] pg_ctl: could not open PID file "/databases/postgresql/8.3/postmaster.pid": Permission denied

I've tried to reinstall Postgres, but nothing changed.
LVL 13
R7AFAsked:
Who is Participating?
 
R7AFConnect With a Mentor Author Commented:
I finally solved it. I tried to reinstall postgres, using a different folder than the default one. This failed over and over, mainly to rights issues. In the end I used all default settings, after which the install proceeded normally. Then I copied the data (keeping all rights) to another location. I renamed the original data-folder, and created a dynamic link to the new location.
0
 
gheistCommented:
What is pgadmin? Is it pgadmin3?
You need to run it as user that can connect to pid and socket of postgresql... Or use TCP with username and password.
0
 
R7AFAuthor Commented:
I mean pgadmin3. I've been able to run Postgresql before. At some point you need to login. However, when I run Top, I don't see any postgresql processes.
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
gheistConnect With a Mentor Commented:
I have no idea where OSX stores logs.
You may get idea from equivalent of /var/log/messages
Or PostgreSQL log in dir above data dir.
0
 
R7AFAuthor Commented:
The postgres log reports the following:

com.apple.SystemStarter[21] pg_ctl: could not open PID file "/databases/postgresql/8.3/postmaster.pid": Permission denied

Should I look at other logs as well? Which ones in particular?
0
 
gheistCommented:
Check if postgresql user is owner of that file, make sure it is and start again.
0
 
earth man2Connect With a Mentor Commented:
The account that is starting postmaster process cannot delete or create the file
/databases/postgresql/8.3/postmaster.pid

if it exists delete it, check the postgresql admin account has write access to the /databases/postgresql/8.3  directory.
0
 
gheistCommented:
Good to know, thanks for keeping up with discussion.
0
 
R7AFAuthor Commented:
So guess what... That seemed to work, but after a restart... not anymore! Now I'm using the default installation, with the database files in /library/postgresql/8.3/data. Not what I want, but for now this problem is not important enough to give it more attention.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.