I am trying to run a function periodically with pg_cron but every time it wants to execute it throws connection refused. the cron job is created using the postgres user.
pg_hba.conf
local all postgres md5
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only
local all all trust
# IPv4 local connections:
host all all 0.0.0.0/0 md5
host all all 127.0.0.1/32 md5
host postgres postgres localhost trust
# IPv6 local connections:
host all all ::1/128 trust
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 md5
host replication all ::1/128 md5
I've tried adding a .pgpass file but, I don't know where to put it. this is my machine version: Debian GNU/Linux 10 (buster)
pg_cron
run locally or remotely? Which database are you trying to connect to as which user?.pgpass
lives in the user'sHOME
... which in ubuntu (I assume debian will be similar?) would be/var/lib/postgresql
...