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

Re: trouble with pg_dumpall

From: "Tena Sakai" <tsakai(at)gallo(dot)ucsf(dot)edu>
To: "Jeff Frost" <jeff(at)frostconsultingllc(dot)com>,<pgsql-admin(at)postgresql(dot)org>
Cc: <pgsql-admin(at)postgresql(dot)org>
Subject: Re: trouble with pg_dumpall
Date: 2008-02-28 03:12:34
Message-ID: FE44E0D7EAD2ED4BB2165071DB8E328C0378F0DB@egcrc-ex01.egcrc.org (view raw or flat)
Thread:
Lists: pgsql-admin
Hi Jeff,

> I bet the $HOME environment variable isn't
> being set by your cron implementation.
> Try putting an echo $HOME in your script and
> see if it's defined.

I did.  Here's the result:

  +++++++++
  PGUSER: postgres
  PGDATABASE: canon
  PGHOST: localhost
  PGPASSFILE: /usr/local/pgsql/.pgpass
  PGDATA: /usr/local/pgsql/data
  +++++++++
  HOME: /usr/local/pgsql
  Password:
  pg_dumpall: could not connect to database "template1": fe_sendauth: no password supplied

> Is this gentoo perhaps?

It is Redhat Advanced Server 4 on Dell hardware.

Regards,

Tena




-----Original Message-----
From: Jeff Frost [mailto:jeff(at)frostconsultingllc(dot)com]
Sent: Wed 2/27/2008 6:59 PM
To: Tena Sakai
Cc: pgsql-admin(at)postgresql(dot)org
Subject: RE: [ADMIN] trouble with pg_dumpall
 
On Wed, 27 Feb 2008, Tena Sakai wrote:

> Hi Jeff,
>
> Thanks for your reply, but I think you might
> have missed an earlier thread.  I am afraid
> I have tried what you suggest.  Below's my
> previous post.
>
>
>  filename=`date +%G%m%d.%w`.gz
>  /usr/local/pgsql/bin/pg_dumpall > $filename
>
> Here's what I get back as output is:
>
>  Password:
>  pg_dumpall: could not connect to database "template1": fe_sendauth: no password supplied
>
> This is not what happened on 8.2.4.  I read 8.3.0 man
> page on pg_dumpall.  Here's what it told me:
>
>  The file .pgpass in a user's home directory or the file referenced
>  by PGPASSFILE can contain passwords to be used if the connection
>  requires a password (and no password has been specified otherwise).
>
> I have .pgpass in /usr/local/pgsql and when I type
>  psql dbname
> It lets me in without asking the password.  So I don't
> understand why I get what I get: fe_sendauth: no password supplied
>

Please reply-all and don't top-post. :-)

I bet the $HOME environment variable isn't being set by your cron 
implementation.  Is this gentoo perhaps?  Try putting an echo $HOME in your 
script and see if it's defined.

-- 
Jeff Frost, Owner 	<jeff(at)frostconsultingllc(dot)com>
Frost Consulting, LLC 	http://www.frostconsultingllc.com/
Phone: 650-780-7908	FAX: 650-649-1954

In response to

Responses

pgsql-admin by date

Next:From: Steve HoldowayDate: 2008-02-28 03:33:41
Subject: Re: trouble with pg_dumpall
Previous:From: Jeff FrostDate: 2008-02-28 02:59:59
Subject: Re: trouble with pg_dumpall

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