Connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?


[postgres@srv data]$ psql -l
psql: could not connect to server: No such file or directory
              Is the server running locally and accepting
              Connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?
That simple way is please update postgres home, bin, library details in  .bash_profile

[postgres@srv data]$cd 
[postgres@srv ~]$vi .bash_profile
if [ -f ~/.bashrc ]; then

. ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/.local/bin:$HOME/bin

export PATH
export PG_HOME=/home/postgres/pgsql
export PATH=$PG_HOME/bin:$PATH:.
export PG_DATA=/home/postgres/data

save the details using esc, :wq

[postgres@srv ~]$. .bash_profile

hopefully this could resolve the issue.