Re: Unix domain sockets

From: Giles Lean <giles(at)nemeton(dot)com(dot)au>
To: Randy Neumann <Randy_Neumann(at)centralref(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Unix domain sockets
Date: 2002-09-06 21:40:20
Message-ID: 11739.1031348420@nemeton.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message torres montaes manuel eduardo 2002-09-06 22:21:48 KDevelop error
Previous Message Curtis Mortensen 2002-09-06 19:08:28 pg_restore error