title: pgagent on windows - Couldn't get a connection to the database
body: <p>Hi I need a little help to get pgagent running on a windows 2008 with postgres 9.2.1
  (ipv4 &amp; ipv6)</p>
  
  <p>I'm logged into the server (remote desktop) and trying to run a job.</p>
  
  <p>If i check the output from the job:</p>
  
  <pre><code>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 &gt; 'now'::text::date
    ORDER BY j.jobname, s.jstname, l.jslstart DESC;
  </code></pre>
  
  <p>I get this in jsloutput = <strong>Couldn't get a connection to the database!</strong></p>
  
  <p>When using pgadminIII to look at the job:</p>
  
  <pre><code>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)
  </code></pre>
  
  <p>This is my pg_hba.conf</p>
  
  <pre><code># 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
  </code></pre>
  
  <p>Any idea what I'm missing??</p>
  
  <ul>
  <li>Niels</li>
  </ul>