I upgraded to postgresql-server-9.0.3-r3 on a gentoo server. When trying to start postgres server I am getting this error: # /etc/init.d/postgresql-9.0 start * Socket conflict. * A server is already listening on: * /var/run/postgresql/.s.PGSQL.5432 * HINT: Change PGPORT to listen on a different socket. I checked and I cannot find anything listening on this port. I have tried changing PGPORT to 5433 and the server starts but then when I try to log into the server I get this: $ psql postgres psql: could not connect to server: Connection refused Is the server running locally and accepting connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"? If I log in specifying the port I can log in: $ psql --port 5433 postgres Password: psql (8.4.7, server 9.0.3) WARNING: psql version 8.4, server version 9.0. Some psql features might not work. Type "help" for help. postgres=# I am just not sure of what the fix is for this. How do I get it to use port 5433 when logging into the database? Or is changing the port to 5433 not the correct thing to do? Please help, any help would be greatly appreciated. Reproducible: Always
There really isn't any good reason for there a server to be listening on /var/run/postgresql/.s.PGSQL.5432 unless the server shutdown really uncleanly. So, the only thing that stands to reason is that you still have a server listening there. What's the output of: /etc/init.d/postgresql-8.4 status
(In reply to comment #1) > There really isn't any good reason for there a server to be listening on > /var/run/postgresql/.s.PGSQL.5432 unless the server shutdown really uncleanly. > So, the only thing that stands to reason is that you still have a server > listening there. > What's the output of: > /etc/init.d/postgresql-8.4 status This is the output of /etc/init.d/postgresql-8.4 status # /etc/init.d/postgresql-8.4 status * status: stopped * Reloading PostgreSQL configuration ... pg_ctl: no server running
I figured out the solution. Look for .s.PGSQL.5432 in /var/run/postgresql/ ls /var/run/postgresql/.s.PGSQL.5432 Then delete it rm /var/run/postgresql/.s.PGSQL.5432 and then start server
Can't troubleshoot this any further then.