pgadmin-org / pgagent

pgAgent - A job scheduler for PostgreSQL
https://www.pgadmin.org/
Other
97 stars 41 forks source link

PgAgent seems to ignore .pgpass whenever it has 127.0.0.1 (127.0.0.1:5432:*:postgres:postgres) throws an error: #14

Closed nagbandla closed 5 years ago

nagbandla commented 6 years ago

PgAgent is not inline with standard program psql program for passing host address in connection string. PgAgent is passing host address to libpq with always ‘hostaddr=’ instead of ‘host=’ Because of this, when we run pgagent with command – “/usr/bin/pgagent -f -l 2 hostaddr=127.0.0.1 dbname=linuxpostgresdb user=postgres port=5432”

PgAgent seems to ignore .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

If the .pgpass is modified to have the contents( localhost:5432:*:postgres:postgres), then above pgAgent command works fine without complaining.

When we change pgAgent code, where connection.cpp:461 like the below; It works in line to the psql program. connStr += wxT(" host=") + host;

With this change, pgAgent is in line with itself. Since the command line string should always match with pgpass.conf.

Can you please incorporate this change.

repo-lockdown[bot] commented 5 years ago

Thanks for your Pull Request! :smile: This repo on GitHub is just a mirror of our real git repositories though, and can't really handle PRs. :frowning: Hopefully you can redo the PR, and direct it to the git.postgresql.org repos? We have a developer guide, if that helps: https://wiki.postgresql.org/wiki/So,_you_want_to_be_a_developer%3F. If this was a PR for pgAdmin, please visit https://www.pgadmin.org/docs/pgadmin4/dev/submitting_patches.html.