I have figured out the issue with pgAgent both in
Windows and Linux.
PgAgent
seems to ignore pgpass.conf/.pgpass whenever it has
127.0.0.1 (127.0.0.1:5432:*:postgres:postgres)
throws an error:
DEBUG: Creating DB
connection: user=postgres
port=5432 hostaddr=127.0.0.1 dbname=linuxpostgresdb
WARNING:
Couldn't create the primary connection (attempt 1):
fe_sendauth: no password
supplied
The
solution could be update .pgpass to have (
localhost:5432:*:postgres:postgres
) and then pgagent works fine without issues.
I
think, pgagent is not inline with libpq.dll while passing
host address parameter. I have raised this concern with
pgagent github where exactly they need to change
the
code in order for pgagent to be in line with psql program.