When I use postgres, the job works, but when I use ydz2, the job doesn't work:
Couldn't get a connection to the database
Both of them are my local database.
Job Step
Job Step Statistics
Where should I configure it?
Thank you.
When I use postgres, the job works, but when I use ydz2, the job doesn't work:
Couldn't get a connection to the database
Both of them are my local database.
Job Step
Job Step Statistics
Where should I configure it?
Thank you.
It seems pgagent cannot connect to the database, which might be because you didn't provide the required credentials. Make sure your .pgpass file is properly configured.
Assuming you're using the user postgres
for pgAgent and that you have installed the extension in the database postgres
:
$ sudo su - postgres
$ cd ~
$ nano .pgpass
Insert the following text and save the document:
localhost:5432:*:postgres:[postgres_password]
This line basically tells the database connection to use the given password for the user postgres
to connect to any (*
) database on the server localhost
listening on the port 5432
.
Once you're done with the .pgpass, give the file the proper permissions:
$ chmod 0600 .pgpass
You might need to restart pgAgent (not sure if it's necessary):
$ pgagent hostaddr=localhost dbname=postgres user=postgres