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

I am trying to configure a PostgreSQL database. Postgres is installed and running, but the PID file that it creates by default is different from what psycopg2 wants (which is /var/run/postgresql/.s.PGSQL.5432).

When I change /etc/postgresql/8.4/main/postgresql.conf to reflect this file, it fails silently and doesn't create the file. I tried a different file name that did not begin with a dot and it worked.

Is there a way to force Postgres to create this file, or to change the path that psycopg2 looks at to connect?

Thanks.

share|improve this question
1  
What you are describing the is not a PID file, but a Unix domain socket file. Also, if something fails, show the error message. If you change a configuration file, say what you changed. –  Peter Eisentraut Aug 25 '11 at 10:07

1 Answer 1

You can set unix_socket_directory in your postgresql.conf to force your server to put the socket in /var/run/postgresql. I'm not positive where psycopg2 picks up the default path from, I wouldn't be surprised if it were compiled in based on the default.

share|improve this answer
    
That's fine, but it doesn't solve my problem. Postgres is responding to most changes to PID file parameters, it just won't create a file that begins with a dot, which is what psycopg2 looks for. I suppose I supplied an inappropriate title. It should have been "How can I change the PID file that psycopg2 looks for?" but I believe that is moot because it has to be done by postgres. –  user699397 Aug 25 '11 at 4:09

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.