Re: Unix domain sockets - Mailing list pgsql-novice

From Giles Lean
Subject Re: Unix domain sockets
Date
Msg-id 11739.1031348420@nemeton.com.au
Whole thread Raw
In response to Unix domain sockets  (Randy Neumann <Randy_Neumann@centralref.com>)
Responses Re: Unix domain sockets  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-novice
Randy Neumann writes:

> However after about 3 days I start to get the error:
>
> psql: could not connect to server: No such file or directory
>     Is the server running locally and accepting
>     connections on Unix domain socket "/tmp/.s.PGSQL.5432"?

Perhaps the system cleans "old" files from /tmp?

If that is the case, you can move the socket (but all clients need to
know), update the timestamp on the socket and lock file now and then,
or switch to using TCP/IP for even local connections.

On a system where I have this problem I run a cron job to "freshen"
the timestamp of the socket and the lock file via utimes(2).  I can
dig the code up if anyone wants it, but it's pretty much just:

    utimes("/tmp/.s.PGSQL.5432", (const struct timeval *) 0);

Depending on your system's implementation touch(1) might be enough.

Regards,

Giles


pgsql-novice by date:

Previous
From: "Curtis Mortensen"
Date:
Subject: pg_restore error
Next
From: Giles Lean
Date:
Subject: Re: pg_restore error