LOG: listening on Unix socket "/u01/postgresql/.s.PGSQL.5437" LOG: listening on Unix socket "/tmp/.s.PGSQL.5437"
...
[root@zardplpsmasdev01 ~]# su - postgres -c "psql" psql: error: could not connect to server: 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"?
You probably have multiple binaries installed coming from different packages or package managers. psql is searching for the socket in one place, which is not either of the two places the server is listening. You could explicitly tell it where to connect with either `-h /tmp`, or `-h 127.0.0.1`. Or you could find the correct "psql" to run (the one that came with the running server) so that it just knows where to look, possibly uninstalling the wrong psql to minimize future confusion.