【问题标题】:pgagent on windows - Couldn't get a connection to the databaseWindows上的pgagent - 无法连接到数据库
【发布时间】:2018-07-16 20:38:47
【问题描述】:

您好,我需要一点帮助才能让 pgagent 在带有 postgres 9.2.1 的 Windows 2008 上运行 (ipv4 & ipv6)

我已登录服务器(远程桌面)并尝试运行作业。

如果我检查作业的输出:

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;

我在 jsloutput = 无法连接到数据库!

使用pgadminIII查看作业时:

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)

这是我的 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

知道我错过了什么吗??

  • 尼尔斯

【问题讨论】:

  • 即使使用本地连接,您可能仍需要帐户信息,具体取决于数据库实例的配置方式。
  • 我有同样的问题,在这里发布了不同的信息:stackoverflow.com/questions/15867145/…

标签: pgadmin pgagent


【解决方案1】:

在服务器上找到连接文件 C:\Users\[pgagent 服务用户名]\AppData\Roaming\postgresql\pgpass.conf 并确保连接字符串在那里。

如果您在安装 pgAgent 时提供了与默认 postgres 数据库的连接,那么即使用户具有访问权限,您也无法在其他数据库上运行作业。至少根据我的经验,我必须为每个数据库添加连接字符串。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-28
    • 2010-12-18
    • 1970-01-01
    • 2021-07-24
    • 2020-01-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多