Skip site navigation (1) Skip section navigation (2)

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: (view raw, whole thread or download thread mbox)
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.




pgsql-novice by date

Next:From: torres montaes manuel eduardoDate: 2002-09-06 22:21:48
Subject: KDevelop error
Previous:From: Curtis MortensenDate: 2002-09-06 19:08:28
Subject: pg_restore error

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group