<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 12pt; color: #000000'>You'll also need to look at the pg_hba.conf file in the PostgreSQL data directory. It's often in ~postgres/data or ~postgres/9.3/data (sub your version number) but can vary by distro. This file controls, who can login from what hosts using what kind of credentials. So to use the method below, you'd need a line allowing your host, or host range, to connect via password (md5). <div><br></div><div>If you have your pg_dumpall command working locally, you may consider executing it remotely via ssh. You could create a dedicated user on the DB machine (say 'dbhost') with limited rights, but the ability to perform a pg_dumpall. Then you could do something like:</div><div><br></div><div>ssh dbhost pg_dumpall (other params here) > dbhost.sql</div><div><br></div><div>The dbhost.sql would be created on the local machine, not dbhost.sql. You could set up your ssh key without a passphrase so no prompt would occur.<br><br><hr id="zwchr"><div style="color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><b>From: </b>"James Sumners" <james.sumners@gmail.com><br><b>To: </b>"Atlanta Linux Enthusiasts" <ale@ale.org><br><b>Sent: </b>Monday, September 28, 2015 10:46:14 AM<br><b>Subject: </b>Re: [ale] Postgreq backup help<br><br><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Sep 28, 2015 at 10:35 AM, Beddingfield, Allen <span dir="ltr"><<a href="mailto:allen@ua.edu" target="_blank">allen@ua.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="direction:ltr;font-family:Tahoma;color:#000000;font-size:10pt">Okay, so I've gotten the .pgpass to work without any issue.<br>
The file is in ~/.pgpass, with permissions of 600<br>
<br>
The file looks like:<br>
<hostname>.<a href="http://ua.edu:5432" target="_blank">ua.edu:5432</a>:<dbname>:<user>:<password><br>
<br>
I can do:<br>
pg_dump -h <hostname>.<a href="http://ua.edu" target="_blank">ua.edu</a> -d <dbname> -U <user> -w<br>
<div><br>
This works, dumping out that database, without prompting for a password.<br>
<br>
I want to be able to do pg_dumpall (I want a one file backup to re-add users, databases, grants, etc...) - similar to a MySQL --all-databases backup.<br>
<br>
When I try:<br>
pg_dumpall -h <hostname>.<a href="http://ua.edu" target="_blank">ua.edu</a> -U <user> -w<br>
<br>
I get:<br>
pg_dumpall: could not connect to database "template1": fe_sendauth: no password supplied<br>
<br>
Any ideas?</div></div></blockquote></div><br>Wildcards work in pretty much any field. So put a '*' in the database field.<br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div>James Sumners<br><a href="http://james.sumners.info/" target="_blank">http://james.sumners.info/</a> (technical profile)</div><div><a href="http://jrfom.com/" target="_blank">http://jrfom.com/</a> (personal site)</div><div><a href="http://haplo.bandcamp.com/" target="_blank">http://haplo.bandcamp.com/</a> (band page)</div></div></div></div></div>
</div></div>
<br>_______________________________________________<br>Ale mailing list<br>Ale@ale.org<br>http://mail.ale.org/mailman/listinfo/ale<br>See JOBS, ANNOUNCE and SCHOOLS lists at<br>http://mail.ale.org/mailman/listinfo<br></div><br></div></div></body></html>