Re: .pgpass - Mailing list pgsql-novice

From Tom Lane
Subject Re: .pgpass
Date
Msg-id 27622.1088695632@sss.pgh.pa.us
Whole thread Raw
In response to .pgpass  (<ghaverla@freenet.edmonton.ab.ca>)
Responses Re: .pgpass  (<ghaverla@freenet.edmonton.ab.ca>)
Re: .pgpass  (<ghaverla@freenet.edmonton.ab.ca>)
List pgsql-novice
<ghaverla@freenet.edmonton.ab.ca> writes:
> I'm running Debian unstable, and I keep getting a message from a
> cron job that wants to do.maintenance about no password being
> supplied.

> Now, I gather in the past a person had to explicitly put a
> password in the cron job, but we are now supposed to use a file
> called ~/.pgpass (~ being /var/lib/postgres).

That is the recommended solution, but I'll bet that the cron job is not
running with the same value of $HOME that you think it is, and so it is
failing to find the file.  You might want to explicitly set $HOME in the
script.

Also, test the .pgpass file by manually running psql with it; if there
is something wrong with the file contents you'll be able to prove it...

            regards, tom lane

pgsql-novice by date:

Previous
From: Tom Lane
Date:
Subject: Re: regression test
Next
From:
Date:
Subject: Re: .pgpass