Re: pg_dump cannot connect when executing by a script

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump cannot connect when executing by a script
Date: 2010-05-25 11:13:40
Message-ID: 20100525111340.GC25341@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John Gage 2010-05-25 11:26:55 Re: Apache authorization using postgres
Previous Message Sam Mason 2010-05-25 10:47:31 Re: Hiding data in postgresql