First check if PostgreSQL is running on the server using ps command.
#ps aux | grep postgre
postgres 4335 2.4 0.2 27704 2936 ? S 12:07 0:00 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data
postgres 4337 0.0 0.0 9972 548 ? S 12:07 0:00 postgres: logger process
postgres 4339 0.0 0.0 27704 804 ? S 12:07 0:00 postgres: writer process
postgres 4340 0.0 0.0 10972 544 ? S 12:07 0:00 postgres: stats buffer process
postgres 4341 0.0 0.0 10148 668 ? S 12:07 0:00 postgres: stats collector process
root 4346 0.0 0.0 3912 676 pts/5 S+ 12:07 0:00 grep postgre
If you get the above results, it means PostgreSQL is running locally on the server.
Then check parameter “unix_socket_directory” in the PostgreSQL configuration file
(var/lib/pgsql/data/postgresql.conf) and set it to “/tmp/”
ie, unix_socket_directory =”/tmp/”
Then restart PostgreSQL using PostgreSQL daemon or script
#/etc/init.d/postgresql restart or /scripts/restartsrv_postgresql
#ps aux | grep postgre
postgres 4335 2.4 0.2 27704 2936 ? S 12:07 0:00 /usr/bin/postmaster -p 5432 -D /var/lib/pgsql/data
postgres 4337 0.0 0.0 9972 548 ? S 12:07 0:00 postgres: logger process
postgres 4339 0.0 0.0 27704 804 ? S 12:07 0:00 postgres: writer process
postgres 4340 0.0 0.0 10972 544 ? S 12:07 0:00 postgres: stats buffer process
postgres 4341 0.0 0.0 10148 668 ? S 12:07 0:00 postgres: stats collector process
root 4346 0.0 0.0 3912 676 pts/5 S+ 12:07 0:00 grep postgre
If you get the above results, it means PostgreSQL is running locally on the server.
Then check parameter “unix_socket_directory” in the PostgreSQL configuration file
(var/lib/pgsql/data/postgresql.conf) and set it to “/tmp/”
ie, unix_socket_directory =”/tmp/”
Then restart PostgreSQL using PostgreSQL daemon or script
#/etc/init.d/postgresql restart or /scripts/restartsrv_postgresql
COMMENTS