By default, my PostgreSQL installation was creating a socket in /tmp but my psql command-line client was looking in /var/run/postgresql/.s.PGSQL.5432.
To remedy this, I edited postgresql.conf and changed the directory to
unix_socket_directories = '/var/run/postgresql/'
Unfortunately, there is by default, no postgresql directory in the var/run directory. So, I created it and started the server, and it all worked well. As soon as I shutdown and restart the server, for some reason the /var/run/postgresql directory disappears. This causes the startup of postgres to crash with an error:
FATAL: could not create lock file "/var/run/postgresql/.s.PGSQL.5432.lock": No such file or directory
Help appreciated!