Yann Ramin <atrus@atrustrivalie.org> writes:
> Simply remove /tmp/.s.PGSQL.5432. Its safe to do this in a startup script.
> Postgres isn't too good about removing its UNIX socket if it has a
> semi-nonclean shutdown (system reboot among other things).
Although that's been a standard workaround for a long time, I've always
considered it fairly dangerous: what if the script is invoked at a time
other than system boot? Fortunately, it should no longer be necessary
as of Postgres 7.1 --- we now have code to check for and remove a
leftover socket file safely. I now recommend removing any automatic
socket-file deletion you may have in your startup script.
regards, tom lane