Installed pg_cron
and scheduled job, though there is connection error because job is not done and cron.job_run_details
table shows connection failed
error message.
As doc says:
Important: Internally, pg_cron uses libpq to open a new connection to the local database. It may be necessary to enable trust authentication for connections coming from localhost in pg_hba.conf for the user running the cron job. Alternatively, you can add the password to a .pgpass file, which libpq will use when opening a connection.
Created file .pgpass
with needed parameters, but not sure how to "tell" to libpq that for this user, for this host and DB read this .pgpass
file.
Any help appreciated.
.pgpass
file, but after little bit more googling, I found different solution which worked for me.