[KLUG Members] Postgresql + $HOME/.pgpass

Richard Zimmerman ke4rit at knbpower.com
Fri Oct 7 14:08:33 EDT 2005


Hey guys,

  I'm having problems getting pg_dumpall to work from a script. The idea 
is to have a cron job run overnight to backup the database and vacuum 
it. I'm using the following command line:

/usr/bin/pg_dumpall -vc -U ke4rit > /work/postgres/postgresql.dump

I have the $HOME/.pgpass file created as /root/.pgpass and the 
permissions are 0600 per the one scrap of into I could find about it.
The format of the .pgpass file is:

localhost:5432:template1:ke4rit:<password removed> as suggested.

I keep getting the following error as it's being run from root:

dabatase:~# /usr/bin/pg_dumpall -vc -U ke4rit > 
/work/postgres/postgresql.dump
pg_dumpall: could not connect to database "template1": FATAL:  IDENT 
authentication failed for user "ke4rit"

I have connected as user postgres and specifically set a password to 
make sure I had the RIGHT password on both the postgres account and the 
system account but to no avail...

Question... Do you enter the MD5 hash for the password in /root/.pgpass 
or the human readable (example testpwd verse 'MD5@$%#^#@' ?   I have 
tried both ways to no avail...

I'm really perplexed on this one. A search of the internet really hasn't 
provided me with any clues either.

I COULD just setup the job under the ke4rit user crontab but I'd prefer 
to keep all system related cron job in the root crontab.

Any help is appreciated.

Richard

-- 
Richard "Goose" Zimmerman
Safety Assistant / IT Guru
K&B Transport, Inc. - Elkhart, IN
(574) 389-1986   (574) 389-8527 Fax
(800) 548-2718   (574) 850-5764 Cell 



More information about the Members mailing list