sql - 如何在windows上安装pgAgent服务

标签 sql postgresql postgresql-9.2

我是 postgreSQL 数据库的新手,我最近发现 postgreSQL 通过 pgAgent 支持 SQL Job。我正在使用 Windows XP 操作系统。

我在 Google 上搜索了很多关于 pgAgent 的信息,并尝试在机器上配置 pgAgent。

下载 pgAgent 包,在执行此文件后,我在其中找到了 pgagent.sql 文件 JOB(0) 图标出现在我的 pgAdmin III 对象面板上。 如下图所示。

enter image description here

但是我在注册 pgAgent 服务时遇到了问题。根据 postgres sql 文档,以下是注册服务的后续步骤,但我无法做到这一点。或者不知道如何配置 pgAgent 服务。

来自 postgre sql 文档的以下步骤:

The service may be quite simply installed from the command line as follows:
"C:\Program Files\pgAdmin III\pgAgent" INSTALL pgAgent -u postgres -p secret hostaddr=127.0.0.1 dbname=pgadmin user=postgres

但我尝试了很多,请帮助如何在 Windows XP 中注册 pgAgent 服务。

postgre sql引用链接:http://www.pgadmin.org/docs/1.6/pgagent-install.html

请帮助,在此先感谢!

最佳答案

可能没有安装PgAgent

pgAgent download page说:

pgAgent is a job scheduler for PostgreSQL which may be managed using pgAdmin. Prior to pgAdmin v1.9, pgAgent shipped as part of pgAdmin. From pgAdmin v1.9 onwards, pgAgent is shipped as a separate application.

然后它提供了一个下载链接到http://www.postgresql.org/ftp/pgadmin3/release/pgagent/
但问题是那里只有源代码。 tarball 中也有 SQL 文件,但如果没有 pgagent.exe,它们将毫无用处。

如何安装

显然,安装预编译的 pgAgent 的正确方法是使用 Stack Builder 安装程序,这也是 Windows 上 PostgreSQL 服务器本身的主要安装方法.这是官方下载页面上的建议: http://www.postgresql.org/download/windows/

如果您已经使用此方法安装了 PostgreSQL for Windows,则安装程序位于 Windows 开始菜单的 PostgreSQL 9.2 文件夹中,名称为 Application Stack Builder

StackBuilder 通常会识别您安装的 PostgreSQL 版本,并建议在 附加组件、工具和实用程序 类别中的各种程序中安装 pgAgent。 检查 pgAgent 并继续安装后,它将下载并启动其安装程序。设置阶段包括运行必要的 SQL 语句和安装 PostgreSQL 调度代理 - pgAgent windows 服务。如果此步骤成功,则无需执行任何其他操作,该功能将在 pgAdmin 中用于创建作业。

文档中有什么误导性

最新的 pgAdmin 文档位于 http://www.pgadmin.org/docs/1.16/pgagent-install.html有一个Windows 上的服务安装 章节说:

The service may be quite simply installed from the command line as follows (adjusting the path as required):

"C:\Program Files\pgAdmin III\pgAgent" INSTALL pgAgent -u postgres -p secret hostaddr=127.0.0.1 dbname=postgres user=postgres

然而,在大多数情况下,这不会有帮助,因为:

  • pgAgent 安装由 StackBuilder 启动的 pgAgent 安装程序完成,此步骤不是必需的。
  • 或者您只有 pgAdmin 并且 pgagent.exe 将不会安装,因此无法执行此步骤。

关于sql - 如何在windows上安装pgAgent服务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17567168/

相关文章:

mysql - 连接这两个表的方法是什么?

mysql - 五表连接?

python - 如何为 geoalchemy2 类型使用 SQLAlchemy @compiles 装饰器

Postgresql - 由于某些自动连接到数据库而无法删除数据库

sql - PostgreSQL,在存储过程中存储多个变量

mysql - 遍历mysql中的select语句

mysql - 显示 View sql 时出错

postgresql - 如何在 Postgres 中将 bytea 转换为 base64

SQL:在 column1 上选择 distinct 并对合并行的 column2 值求和

postgresql - 为选择中的每一行调用一个函数 - Postgres