I've solved the issue. pgagent.pga_job.jobhostagent must be blank. Thanks
to this link http://forums.enterprisedb.com/posts/list/1419.page
Anyway, the docs say ... "optionally the hostname of a specific machine
running pgAgent, if this job should only run on that specific server. If
left empty, any server may run the job. This is not normally an issue for
SQL-only jobs, however any jobs with batch/shell steps may need to be
targetted to a specific server." ..., so why didn't it work when I specified
the host of 127.0.0.1 or localhost?
Thanks