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

trouble with pg_dumpall

From: "Tena Sakai" <tsakai(at)gallo(dot)ucsf(dot)edu>
To: <pgsql-admin(at)postgresql(dot)org>
Subject: trouble with pg_dumpall
Date: 2008-02-28 01:12:40
Message-ID: FE44E0D7EAD2ED4BB2165071DB8E328C0378F0D2@egcrc-ex01.egcrc.org (view raw or flat)
Thread:
Lists: pgsql-admin
Hi Everybody,

I started running 8.3.0 recently on dell hardware
with redhat advanced server 4.

I have a problem with pg_dumpall via crontab.
I had a simple crontab to do the same thing on
8.2.4 and the same thing doesn't work.

Here's my very simple crontab entry:

  xx xx * * * sh /usr/local/pgsql/cron_dir/moo.sh

and moo.sh is eqally simple:
  #! /bin/bash

  . .bashrc

  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

I ran a different cron job which looks like:

  #! /bin/bash

  . .bashrc

  echo PGUSER: $PGUSER
  echo PGDATABASE: $PGDATABASE
  echo PGHOST: $PGHOST
  echo PGPASSFILE: $PGPASSFILE
  echo PGDATA: $PGDATA

and everything it told me checks out with what I get from
interactive session.

Please tell me what I am doing wrong.  I am at the
end of my wits.

Regards,

Tena Sakai
tsakai(at)gallo(dot)ucsf(dot)edu

Responses

pgsql-admin by date

Next:From: Phillip SmithDate: 2008-02-28 01:19:18
Subject: Re: trouble with pg_dumpall
Previous:From: salmanDate: 2008-02-27 21:05:47
Subject: Re: Failover of the Primary database and starting the standby database in Postgresql in PITR configuraiton?

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