Back to my original question, though. Any ideas why it is still prompting for password even though it had ‘trust’ in the pg_hba.conf? The .pgpass or the PGPASSWORD is only a work-around for that, I think. ‘Trust’ is supposed to:
Allow the connection unconditionally. This method allows anyone that can connect to the PostgreSQL database server to login as any PostgreSQL user they wish, without the need for a password or any other authentication
So, I shouldn’t need to set-up .pgpass or PGPASSWORD.
Any thoughts?
After modifying pg_hba.conf, did you reload the server?
The other thing to keep in mind is that if you are using unix sockets, you'll need a 'local db user trust' line, and if you're using remote, you'll need a 'host / hostssl / hostnossl' line for that server.... then, reload (pg_ctl reload)
-- Scott Mead Sr. Architect OpenSCG PostgreSQL, Java & Linux Experts
work phone: 517.367.3099 work phone extension: 23099
From: Glauco Torres [mailto:torres.glauco@gmail.com] Sent: Tuesday, October 20, 2015 1:54 PM To: Rossi, Maria <maria.rossi@jackson.com> Subject: Re: [ADMIN] Logging on without prompt for password
We will try the .pgpass file at the user’s home directory, using *.* for port as suggested by Scott Mead. This way I don’t have to worry about setting the PGPASSWORD env var for the user.
I still need to create a role for the user, correct? It needs admin to be able to rung pg_dumpall.
Thanks everyone.
The manual helps a lot in these types of doubts
"Also you will need superuser privileges to execute the saved script in order to be allowed to add users and groups, and to create databases."
O copied the wrong part "Since pg_dumpall reads tables from all databases you will most likely have to connect as a database superuser in order to produce a complete dump."