简体   繁体   English

如何在 Postgres 中使用 PgAgent 作业调度程序执行 INSERT 语句

[英]how to execute INSERT statement using PgAgent Job scheduler in Postgres

I have his query我有他的疑问

INSERT INTO public.mb51_helper(
    plant)
    VALUES ('1826')
;

Every hour.每隔一小时。 I have setup all everything.我已经设置了所有东西。 PgAgent Service is running in services but it is not executing the query. PgAgent 服务正在服务中运行,但它没有执行查询。

Change the value of PgAgent in registry.更改注册表中 PgAgent 的值。 I went to the HKEY_LOCAL_MACHINE/SYSTEM/CURRENT_CONTROL_SET?SERVICES/pgAgent我去了 HKEY_LOCAL_MACHINE/SYSTEM/CURRENT_CONTROL_SET?SERVICES/pgAgent

Change the image path.更改图像路径。 To the folder path of the PgAgent is present "C:/Program Files/PostgresSQL/12/bin/pgagent.exe" RUN pgAgent -u WINDOWS_USER -p WINDOWS_PASSWORD hostaddr=127.0.0.1 dbname=postgres user=postgres password=postgres PgAgent 的文件夹路径存在 "C:/Program Files/PostgresSQL/12/bin/pgagent.exe" RUN pgAgent -u WINDOWS_USER -p WINDOWS_PASSWORD hostaddr=127.0.0.1 dbname=postgres user=postgres password=postgres

And the the OBJECT NAME To NT AUTHORITY\NETWORKSERVICE和 OBJECT NAME 到 NT AUTHORITY\NETWORKSERVICE

You can change this in going to services or directly by changing the name of the object.您可以在转到服务中或直接通过更改 object 的名称来更改此设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM