Re: pg_dump cannot connect when executing by a script - Mailing list pgsql-general

From A. Kretschmer
Subject Re: pg_dump cannot connect when executing by a script
Date
Msg-id 20100525111340.GC25341@a-kretschmer.de
Whole thread Raw
In response to pg_dump cannot connect when executing by a script  (Luca Ferrari <fluca1978@infinito.it>)
Responses Re: pg_dump cannot connect when executing by a script  (Luca Ferrari <fluca1978@infinito.it>)
List pgsql-general
In response to Luca Ferrari :
> Hi all,
> I've found in the net a lot of problems similar to mine, but not the solution
> for my case: when I executed pg_dump against a database from a script (that
> will be executed by cron) I got the following error:
>
> pg_dump: [archiver (db)] connection to database "webcalendardb" failed: 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"?

Your unix-scket isn't in /tmp.

Start psql -h localhost and type:

show unix_socket_directory;

This will show you the corrent path to the unix-socket. You can use that
for pg_dump with option -h </path/to/the/socket-dir>


Regards, Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

pgsql-general by date:

Previous
From: Luca Ferrari
Date:
Subject: pg_dump cannot connect when executing by a script
Next
From: John Gage
Date:
Subject: Re: Apache authorization using postgres