0

Hi I need a little help to get pgagent running on a windows 2008 with postgres 9.2.1 (ipv4 & ipv6)

I'm logged into the server (remote desktop) and trying to run a job.

If i check the output from the job:

SELECT j.jobname, s.jstname, l.jslstart, l.jslduration, l.jsloutput
   FROM pgagent.pga_jobsteplog l
   JOIN pgagent.pga_jobstep s ON s.jstid = l.jsljstid
   JOIN pgagent.pga_job j ON j.jobid = s.jstjobid
  WHERE l.jslstart > 'now'::text::date
  ORDER BY j.jobname, s.jstname, l.jslstart DESC;

I get this in jsloutput = Couldn't get a connection to the database!

When using pgadminIII to look at the job:

Enabled = checked
Connection type = local
Database = cachedb
Connection string = (It's empty can't fill when using local connection type)
Kind = sql
(doesn't help to select remote connection and fill the connection string)

This is my pg_hba.conf

# TYPE  DATABASE        USER            ADDRESS                 METHOD
# IPv4 local connections:
host    all             all             127.0.0.1/32            md5
host    all             all             0.0.0.1/0            md5
# IPv6 local connections:
host    all             all             ::1/128                 md5

Any idea what I'm missing??

  • Niels
Chris Travers
  • 25,424
  • 6
  • 65
  • 182
dk_nls
  • 13
  • 1
  • 5
  • Even with a local connection, you may still need account information, depending on how the database instance is configured. – eh9 Nov 07 '12 at 13:32
  • I have the same problem, posted here with different info: http://stackoverflow.com/questions/15867145/pgagent-job-fails-with-authentication-error – NathanAldenSr Apr 07 '13 at 21:33

1 Answers1

1

On server locate the connections file C:\Users\[pgagent service username]\AppData\Roaming\postgresql\pgpass.conf and make sure that the connection string is there.

If you provided connection to the default postgres database while installing pgAgent then you won't be able to run jobs on other databases even if the user has access rights. At least in my experience I had to add connection strings for every database.

incognito
  • 2,243
  • 3
  • 14
  • 16