"Gavin Henry" <ghenry(at)suretecsystems(dot)com> writes:
> 1. How can I script the above so passwords aren't asked for?
The cleanest solution is to put the password in a ~/.pgpass file so the
script doesn't need to know it at all. Or you can think about using
non-password-based auth methods, such as IDENT.
regards, tom lane