Santhucool
Santhucool

Reputation: 1706

Pgagent getting error as Could not get a connection to the database

I installed the "pgAgent 3.2.1-1" tool from "Stack Builder 3.1.0" in Windows 8.1 64 bit with “PostgreSQL 9.1.4-1”, I have created a job:

The result of the job execution is

Status: Failed Result: 1 Output: Could not get a connection to the database!

Please help me guys!

Upvotes: 0

Views: 1390

Answers (1)

Santhucool
Santhucool

Reputation: 1706

The file .pgpass in a user's home directory is a file that can contain passwords to be used if the connection requires a password (and no password has been specified otherwise). On Microsoft Windows the file is named %APPDATA%\postgresql\pgpass.conf (where %APPDATA% refers to the Application Data subdirectory in the user's profile). Add the password and Database Schema username inside it and save it. Restart the pgsql service it works!!

Upvotes: 1

Related Questions